* lisp/visual-wrap.el (visual-wrap-extra-indent): Add :version.
(visual-wrap-fill-context-prefix): Doc fix.
* lisp/menu-bar.el (menu-bar-line-wrapping-menu): Move the menu to
a better place, improve the help-echo text.
* etc/NEWS:
* doc/emacs/basic.texi (Continuation Lines): Improve documentation
and indexing of 'visual-wrap-prefix-mode'.
(cherry picked from commit
43e2f3acdd2dbd040ec2fc473ca60ee3179bb796)
can make Emacs insert a newline automatically when a line gets too
long, by using Auto Fill mode. @xref{Filling}.
-@cindex continuation lines, wrapping with prefix
+@cindex continuation lines, visual wrap prefix
@findex visual-wrap-prefix-mode
Normally, the first character of each continuation line is
positioned at the beginning of the screen line where it is displayed.
fill prefixes (@pxref{Fill Prefix}) of their respective logical lines,
so that indentation characters or the prefixes of source code comments
are replicated across every continuation line, and the appearance of
-such comments or indentation is not broken.
+such comments or indentation is not broken. These prefixes are only
+shown on display, and does not change the buffer text in any way.
Sometimes, you may need to edit files containing many long logical
lines, and it may not be practical to break them all up by adding
+++
** New minor mode 'visual-wrap-prefix-mode'.
-
-When enabled, continuation lines displayed for a folded long line will
-receive a 'wrap-prefix' automatically computed from the line's
-surrounding context by the function 'fill-context-prefix', which
-generally indents continuation lines as if the line were filled with
-'M-q', or similar.
-
-This minor mode is the 'adaptive-wrap' ELPA package renamed and
-lightly edited for inclusion in Emacs.
+When enabled, continuation lines displayed for a wrapped long line
+will receive a 'wrap-prefix' automatically computed from the line's
+surrounding context, such that continuation lines are indented on
+display as if they were filled with 'M-q' or similar. Unlike 'M-q',
+the indentation only happens on display, and doesn't change the buffer
+text in any way.
+
+(This minor mode is the 'adaptive-wrap' ELPA package renamed and
+lightly edited for inclusion in Emacs.)
+++
** New user option 'gud-highlight-current-line'.
(defvar menu-bar-line-wrapping-menu
(let ((menu (make-sparse-keymap "Line Wrapping")))
+ (bindings--define-key menu [visual-wrap]
+ '(menu-item "Visual Wrap Prefix mode" visual-wrap-prefix-mode
+ :help "Display continuation lines with visual context-dependent prefix"
+ :visible (menu-bar-menu-frame-live-and-visible-p)
+ :button (:toggle
+ . (bound-and-true-p visual-wrap-prefix-mode))
+ :enable t))
+
(bindings--define-key menu [word-wrap]
'(menu-item "Word Wrap (Visual Line mode)"
menu-bar--visual-line-mode-enable
(not word-wrap)))
:visible (menu-bar-menu-frame-live-and-visible-p)
:enable (not (truncated-partial-width-window-p))))
-
- (bindings--define-key menu [visual-wrap]
- '(menu-item "Visual Wrap Prefix" visual-wrap-prefix-mode
- :help "Display continuation lines with contextual prefix"
- :visible (menu-bar-menu-frame-live-and-visible-p)
- :button (:toggle . (bound-and-true-p visual-wrap-prefix-mode))
- :enable t))
menu))
(defvar menu-bar-search-options-menu
ullamco laboris nisi ut aliquip ex ea commodo consequat."
:type 'integer
:safe 'integerp
+ :version "30.1"
:group 'visual-line)
(defun visual-wrap--face-extend-p (face)
""))))
(defun visual-wrap-fill-context-prefix (beg end)
- "Like `fill-context-prefix', but with length adjusted by
-`visual-wrap-extra-indent'."
+ "Compute visual wrap prefix from text between FROM and TO.
+This is like `fill-context-prefix', but with prefix length adjusted
+by `visual-wrap-extra-indent'."
(let* ((fcp
;; `fill-context-prefix' ignores prefixes that look like
;; paragraph starts, in order to avoid inadvertently