[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/adaptive-wrap db52f0b 01/15: Rename adaptive-wrap-prefi
From: |
Stefan Monnier |
Subject: |
[elpa] externals/adaptive-wrap db52f0b 01/15: Rename adaptive-wrap-prefix to adaptive-wrap. |
Date: |
Sun, 29 Nov 2020 19:09:07 -0500 (EST) |
branch: externals/adaptive-wrap
commit db52f0bdbc57832e3bc38bb20bf1e1ce69c41864
Author: Chong Yidong <cyd@gnu.org>
Commit: Chong Yidong <cyd@gnu.org>
Rename adaptive-wrap-prefix to adaptive-wrap.
The old name overflowed the column in list-packages.
---
adaptive-wrap.el | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/adaptive-wrap.el b/adaptive-wrap.el
new file mode 100644
index 0000000..0f4fc51
--- /dev/null
+++ b/adaptive-wrap.el
@@ -0,0 +1,55 @@
+;;; adaptive-wrap.el --- Smart line-wrapping with wrap-prefix
+
+;; Copyright (C) 2011 Stefan Monnier
+
+;; Author: Stephen Berman <stephen.berman@gmx.net>
+;; Stefan Monnier <monnier@iro.umontreal.ca>
+;; Version: 0.1
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This package provides the `adaptive-wrap-prefix-mode' minor mode which sets
+;; the wrap-prefix property on the fly so that single-long-line paragraphs get
+;; word-wrapped in a way similar to what you'd get with M-q using
+;; adaptive-fill-mode, but without actually changing the buffer's text.
+
+;;; Code:
+
+(defun adaptive-wrap-prefix-function (beg end)
+ "Indent the region between BEG and END with adaptive filling."
+ (goto-char beg)
+ (while (< (point) end)
+ (let ((blp (line-beginning-position)))
+ (put-text-property (point)
+ (progn (search-forward "\n" end 'move) (point))
+ 'wrap-prefix
+ (fill-context-prefix blp (point))))))
+
+;;;###autoload
+(define-minor-mode adaptive-wrap-prefix-mode
+ "Wrap the buffer text with adaptive filling."
+ :lighter ""
+ (if adaptive-wrap-prefix-mode
+ (jit-lock-register #'adaptive-wrap-prefix-function)
+ (jit-lock-unregister #'adaptive-wrap-prefix-function)
+ (with-silent-modifications
+ (save-restriction
+ (widen)
+ (remove-text-properties (point-min) (point-max) '(wrap-prefix nil))))))
+
+
+(provide 'adaptive-wrap)
+;;; adaptive-wrap.el ends here
- [elpa] branch externals/adaptive-wrap created (now 603648e), Stefan Monnier, 2020/11/29
- [elpa] externals/adaptive-wrap db52f0b 01/15: Rename adaptive-wrap-prefix to adaptive-wrap.,
Stefan Monnier <=
- [elpa] externals/adaptive-wrap f78efba 02/15: Add adaptive-wrap-extra-indent., Stefan Monnier, 2020/11/29
- [elpa] externals/adaptive-wrap 77979be 04/15: * adaptive-wrap.el (adaptive-wrap-extra-indent): Fix buffer-localness., Stefan Monnier, 2020/11/29
- [elpa] externals/adaptive-wrap fb4aa4e 06/15: * adaptive-wrap.el (menu-bar-options-menu): Add checkbox for Adaptive Wrap, Stefan Monnier, 2020/11/29
- [elpa] externals/adaptive-wrap 7db060b 07/15: * adaptive-wrap.el: Require easymenu (bug#14974)., Stefan Monnier, 2020/11/29
- [elpa] externals/adaptive-wrap 07e03a8 08/15: * adaptive-wrap.el: Fix bug#14974 by using define-key-after, Stefan Monnier, 2020/11/29
- [elpa] externals/adaptive-wrap ef01f42 09/15: * adaptive-wrap.el (adaptive-wrap-mode): Move after font-lock (bug#15155)., Stefan Monnier, 2020/11/29
- [elpa] externals/adaptive-wrap b17b789 10/15: Mark adaptive-wrap-extra-indent as safe if integerp (Bug#23816), Stefan Monnier, 2020/11/29
- [elpa] externals/adaptive-wrap 710d484 05/15: Fix error during redisplay: (wrong-type-argument stringp nil), Stefan Monnier, 2020/11/29
- [elpa] externals/adaptive-wrap 01e7d1f 14/15: adaptive-wrap: Fontify wrap-prefix, Stefan Monnier, 2020/11/29
- [elpa] externals/adaptive-wrap 603648e 15/15: * .gitignore: New file, Stefan Monnier, 2020/11/29