[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode ca7773df72 102/308: Added `drupal-mode-beginni
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode ca7773df72 102/308: Added `drupal-mode-beginning-of-line' for .info files. |
Date: |
Tue, 25 Jan 2022 10:59:34 -0500 (EST) |
branch: elpa/drupal-mode
commit ca7773df72ca0b920e7bef0b3224bbd722ef398e
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
Added `drupal-mode-beginning-of-line' for .info files.
Allows better navigation in info files. `C-a' can jump to beginning of
property value.
Inspired by and heavily based on `message-beginning-of-line' from
Gnus.
---
drupal-mode.el | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/drupal-mode.el b/drupal-mode.el
index b5473e2080..16e6f25c50 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -191,6 +191,7 @@ Include path to the executable if it is not in your $PATH."
(define-key map [(control c) (control v) (control h)] #'drupal-insert-hook)
(define-key map [(control c) (control v) (control f)]
#'drupal-insert-function)
(define-key map [(control c) (control v) (control m)] #'drupal-module-name)
+ (define-key map [(control a)] #'drupal-mode-beginning-of-line)
map)
"Keymap for `drupal-mode'")
@@ -455,6 +456,35 @@ instead."
((fboundp 'php-extras-eldoc-documentation-function)
(php-extras-eldoc-documentation-function))))))
+(defun drupal-mode-beginning-of-line (&optional n)
+ "Move point to beginning of property value or to beginning of line.
+The prefix argument N is passed directly to `beginning-of-line'.
+
+This command is identical to `beginning-of-line' if not in a mode
+derived from `conf-mode'.
+
+If point is on a (non-continued) property line, move point to the
+beginning of the property value or the beginning of line,
+whichever is closer. If point is already at beginning of line,
+move point to beginning of property value. Therefore, repeated
+calls will toggle point between beginning of property value and
+beginning of line.
+
+Heavily based on `message-beginning-of-line' from Gnus."
+ (interactive "p")
+ (let ((zrs 'zmacs-region-stays))
+ (when (and (featurep 'xemacs) (interactive-p) (boundp zrs))
+ (set zrs t)))
+ (if (derived-mode-p 'conf-mode)
+ (let* ((here (point))
+ (bol (progn (beginning-of-line n) (point)))
+ (eol (point-at-eol))
+ (eoh (re-search-forward "= *" eol t)))
+ (goto-char
+ (if (and eoh (or (< eoh here) (= bol here)))
+ eoh bol)))
+ (beginning-of-line n)))
+
;; Detect Drupal and Drupal version
- [nongnu] elpa/drupal-mode d9745316b3 261/308: Merge pull request #62 from arnested/feature/helm-gtags-compatibility, (continued)
- [nongnu] elpa/drupal-mode d9745316b3 261/308: Merge pull request #62 from arnested/feature/helm-gtags-compatibility, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 0a23dc084a 266/308: Add autoinsert template for .api.php files, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 947b893b37 274/308: Handle case where `c-default-style` is a string, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f93cdfe1b2 278/308: Use proper indent for continuation lines, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 9d793aa112 286/308: Add support for gxref/xref, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode dc82e5430c 295/308: Handle .info.yml files, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode a1c77dca8b 300/308: Prefer HTTPS URLs wherever we can, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 83ee02f80a 024/308: Renamed `drupal-root' to `drupal-rootdir'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 4ef339db0a 045/308: Don't locate standard for each buffer., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 808d1f1768 080/308: Use `eldoc-mode' for function argument tips., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ca7773df72 102/308: Added `drupal-mode-beginning-of-line' for .info files.,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode f17e7088ca 107/308: Provide Drupal projects as webjump sites., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 043644e85d 109/308: Set correct comment style for inline comments., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode dfd4582048 115/308: Fixed argument insert in `drupal-insert-hook'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode dcea92f3a9 117/308: Added autoinsert skeleton for .test files., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 6dd8edc402 121/308: Eliminated compiler warnings., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 16632d6cf7 133/308: Fixed drush version detection for Drush 7., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 58fb25a914 138/308: Added .cask to .gitignore., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode d04b119de7 141/308: Properly add our checkers to flycheck-checkers instead of enforcing it., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 5eb72aba82 162/308: Merge branch 'release/0.3.1' into develop, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 0eac30704b 167/308: Don't delete `'trailing` form `whitespace-style` after all., ELPA Syncer, 2022/01/25