Add `org-increase-number-at-point' bound to C-M-S-<right>

* org.el (org-increase-number-at-point)
(org-decrease-number-at-point): New commands.
(org-mode-map): Bind them to C-M-S-<right> and C-M-S-<left>.
This commit is contained in:
Bastien Guerry 2014-05-20 15:48:01 +02:00
parent bf47838d77
commit b76071f2b6

View file

@ -19180,6 +19180,8 @@ boundaries."
(org-defkey org-mode-map [(meta up)] 'org-metaup)
(org-defkey org-mode-map [(meta down)] 'org-metadown)
(org-defkey org-mode-map [(control meta shift right)] 'org-increase-number-at-point)
(org-defkey org-mode-map [(control meta shift left)] 'org-decrease-number-at-point)
(org-defkey org-mode-map [(meta shift left)] 'org-shiftmetaleft)
(org-defkey org-mode-map [(meta shift right)] 'org-shiftmetaright)
(org-defkey org-mode-map [(meta shift up)] 'org-shiftmetaup)
@ -20252,6 +20254,22 @@ Optional argument N tells to change by that many units."
(org-clock-timestamps-down n))
(user-error "Not at a clock log")))
(defun org-increase-number-at-point (&optional inc)
(interactive "p")
(unless inc (setq inc 1))
(let ((nap (thing-at-point 'number)))
(when nap
(skip-chars-backward "-+0123456789")
(kill-word 1)
(insert (number-to-string (+ inc nap)))))
(when (org-at-table-p)
(org-table-align)
(org-table-end-of-field 1)))
(defun org-decrease-number-at-point (&optional inc)
(interactive "p")
(org-increase-number-at-point (- inc)))
(defun org-ctrl-c-ret ()
"Call `org-table-hline-and-move' or `org-insert-heading' dep. on context."
(interactive)