Bugfix: Make prefix arg with C-a, C-n work correctly.

The special implementation did not look at prefix arguments.

Reported by Ken Harris.
This commit is contained in:
Carsten Dominik 2009-02-15 22:07:59 +01:00
parent 6f2a247611
commit 43f9c50665
2 changed files with 21 additions and 14 deletions

View file

@ -2,6 +2,8 @@
* org.el (org-show-entry): Make this work correctly also if it is * org.el (org-show-entry): Make this work correctly also if it is
the last entry in the file. the last entry in the file.
(org-end-of-line, org-beginning-of-line): Make prefix arg work, by
falling back to normal, default command.
* org-list.el (org-toggle-checkbox): Make double prefix set the * org-list.el (org-toggle-checkbox): Make double prefix set the
checkbox to "[-]". checkbox to "[-]".

View file

@ -4664,8 +4664,6 @@ With numerical argument N, show content up to level N."
This function is the default value of the hook `org-cycle-hook'." This function is the default value of the hook `org-cycle-hook'."
(when (get-buffer-window (current-buffer)) (when (get-buffer-window (current-buffer))
(cond (cond
; ((eq state 'overview) (org-first-headline-recenter 1))
; ((eq state 'overview) (org-beginning-of-line))
((eq state 'content) nil) ((eq state 'content) nil)
((eq state 'all) nil) ((eq state 'all) nil)
((eq state 'folded) nil) ((eq state 'folded) nil)
@ -4886,7 +4884,7 @@ or nil."
(goto-char org-goto-start-pos) (goto-char org-goto-start-pos)
(and (org-invisible-p) (org-show-context))) (and (org-invisible-p) (org-show-context)))
(goto-char (point-min))) (goto-char (point-min)))
(org-beginning-of-line) (let (org-special-ctrl-a/e) (org-beginning-of-line))
(message "Select location and press RET") (message "Select location and press RET")
(use-local-map org-goto-map) (use-local-map org-goto-map)
(recursive-edit) (recursive-edit)
@ -14953,14 +14951,16 @@ beyond the end of the headline."
(interactive "P") (interactive "P")
(let ((pos (point)) refpos) (let ((pos (point)) refpos)
(beginning-of-line 1) (beginning-of-line 1)
(if (bobp) (if (and arg (fboundp 'move-beginning-of-line))
nil (call-interactively 'move-beginning-of-line)
(backward-char 1) (if (bobp)
(if (org-invisible-p) nil
(while (and (not (bobp)) (org-invisible-p)) (backward-char 1)
(backward-char 1) (if (org-invisible-p)
(beginning-of-line 1)) (while (and (not (bobp)) (org-invisible-p))
(forward-char 1))) (backward-char 1)
(beginning-of-line 1))
(forward-char 1))))
(when org-special-ctrl-a/e (when org-special-ctrl-a/e
(cond (cond
((and (looking-at org-complex-heading-regexp) ((and (looking-at org-complex-heading-regexp)
@ -14994,8 +14994,11 @@ first attempt, and only move to after the tags when the cursor is already
beyond the end of the headline." beyond the end of the headline."
(interactive "P") (interactive "P")
(if (or (not org-special-ctrl-a/e) (if (or (not org-special-ctrl-a/e)
(not (org-on-heading-p))) (not (org-on-heading-p))
(end-of-line arg) arg)
(call-interactively (if (fboundp 'move-end-of-line)
'move-end-of-line
'end-of-line))
(let ((pos (point))) (let ((pos (point)))
(beginning-of-line 1) (beginning-of-line 1)
(if (looking-at (org-re ".*?\\([ \t]*\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$")) (if (looking-at (org-re ".*?\\([ \t]*\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$"))
@ -15007,7 +15010,9 @@ beyond the end of the headline."
(if (or (< pos (match-end 0)) (not (eq this-command last-command))) (if (or (< pos (match-end 0)) (not (eq this-command last-command)))
(goto-char (match-end 0)) (goto-char (match-end 0))
(goto-char (match-beginning 1)))) (goto-char (match-beginning 1))))
(end-of-line arg)))) (call-interactively (if (fboundp 'move-end-of-line)
'move-end-of-line
'end-of-line)))))
(org-no-warnings (org-no-warnings
(and (featurep 'xemacs) (setq zmacs-region-stays t)))) (and (featurep 'xemacs) (setq zmacs-region-stays t))))