[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode 5d4558342b 187/308: Added better paragraph fil
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode 5d4558342b 187/308: Added better paragraph filling. |
Date: |
Tue, 25 Jan 2022 10:59:46 -0500 (EST) |
branch: elpa/drupal-mode
commit 5d4558342b8a2f630d7ba20486cde37552cec113
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
Added better paragraph filling.
Text fills better around Doxygen @param et al. and text in comments now
do auto-fill.
Fixes #5.
---
drupal-mode.el | 41 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 40 insertions(+), 1 deletion(-)
diff --git a/drupal-mode.el b/drupal-mode.el
index b085286d3c..2c84391532 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -163,6 +163,36 @@ Include path to the executable if it is not in your $PATH."
:type '(repeat symbol)
:group 'drupal)
+(defcustom drupal-enable-auto-fill-mode t
+ "Whether to use `auto-fill-mode' Drupal PHP buffers.
+Drupal mode will only do auto fill in comments (auto filling code
+is not nice).
+
+If `Yes' enable `auto-fill-mode' in Drupal PHP mode buffers.
+If `No' don't enable `auto-fill-mode' in Drupal PHP mode buffers
(`auto-fill-mode' can still be enabled by other settings)."
+ :type `(choice
+ :tag "Enable `auto-fill-mode'."
+ (const :tag "Yes" t)
+ (const :tag "No" nil))
+ :link '(variable-link comment-auto-fill-only-comments)
+ :group 'drupal)
+
+(defcustom drupal-paragraph-separate "^[
\t]*\\(\\(/[/\\*]+\\)\\|\\(\\*+/\\)\\|\\(\\*?\\)\\|\\(\\*?[
\t]*@[[:alpha:]]+\\([ \t]+.*\\)?\\)\\)[ \t]*$"
+ "Regexp for beginning of a line that separates paragraphs.
+In Drupal mode we extend the regular `paragraph-separate' so we
+will get better filling in Doxygen comments."
+ :type 'regexp
+ :link '(variable-link paragraph-separate)
+ :group 'drupal)
+
+(defcustom drupal-paragraph-start (default-value 'drupal-paragraph-separate)
+ "Regexp for beginning of a line that starts OR separates paragraphs.
+In Drupal mode we extend the regular `paragraph-start' so we will
+get better filling in Doxygen comments."
+ :type 'regexp
+ :link '(variable-link paragraph-start)
+ :group 'drupal)
+
(defvar drupal-version nil "Drupal version as auto detected.")
@@ -273,7 +303,16 @@ function arguments.")
;; Setup cc-mode style stuff.
(when (derived-mode-p 'c-mode)
(c-add-language 'drupal-mode 'c-mode)
- (c-set-style "drupal"))))
+ (c-set-style "drupal"))
+
+ ;; Use `auto-fill' only in comments.
+ (when drupal-enable-auto-fill-mode
+ (set (make-local-variable 'comment-auto-fill-only-comments) t)
+ (auto-fill-mode 1))
+
+ ;; Improve filling in Doxygen comments.
+ (set (make-local-variable 'paragraph-separate) drupal-paragraph-separate)
+ (set (make-local-variable 'paragraph-start) drupal-paragraph-start)))
- [nongnu] elpa/drupal-mode 3ce73dd221 292/308: Fix array member indentation in function calls, (continued)
- [nongnu] elpa/drupal-mode 3ce73dd221 292/308: Fix array member indentation in function calls, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode cca428d723 296/308: Run tests on Emacs 25.3, 26.3, and snapshot, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 3e0ed63e4b 298/308: Fix array member indentation in function calls - take 2, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ed90b0c4d8 303/308: Bump version to 0.7.4, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 53d6809d84 304/308: Fix #84: Use cl-lib instead of deprecated cl, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 5b90a053f7 307/308: Merge pull request #86 from skangas/cl-lib, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 17927723ad 308/308: Merge pull request #85 from skangas/bump-version, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode d71bfb0362 246/308: symbol's value as variable is void: gtags-auto-update, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode eb21f8aaac 232/308: Make flycheck-phpcs-standard buffer local, as it should be., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 003953437c 067/308: Ensured blank line when `drupal-insert-hook'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 5d4558342b 187/308: Added better paragraph filling.,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode 3c84493988 206/308: Added JS mode indentation., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f5fe08ccb3 209/308: Improved `drupal-tail-drupal-debug-txt`., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 0cb4bca4d6 216/308: Added ID suggestions for hook_update_N()., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 44ea6bfd95 221/308: Merge pull request #52 from arnested/flycheck-updates, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 8a432e36cb 231/308: Missing dependency., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode bcf7a8b372 224/308: Introduce an `auto` option for drupal/flymake-phpcs-run-in-place, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 89f2043bde 227/308: Suppress byte-compile-warning., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 73a1531435 242/308: Better default for `drupal/emacs-drush-update-tags-after-save`., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode c727a18be7 226/308: Fixed bug in `drupal-search-documentation`., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 12d79f3507 250/308: Also load gtags.el with helm-gtags., ELPA Syncer, 2022/01/25