3 added 312 characters in body
source | link

I initially misunderstood the requirements, but believe this updated function does the right thing and also corrects the bug the old function had at the beginning of the line:

EDIT: updated to only move the point when a suitable line is found:

(defun down-stantonly ()
  (interactive)
  (let (destination
        (goal-column (current-column))
        (some-non-ws-p
         (lambda ()
           (and (= (current-column) goal-column)
                (let ((pt (+ (if (eolp) 0 1) (point))))
                  (save-excursion
                    (beginning-of-line)
                    (re-search-forward "\\S-" pt t)))))))
    (condition-case x
        (save-excursion
          (while (funcall some-non-ws-p)
            (next-line))
          (while (not (funcall some-non-ws-p))
            (next-line))
          (setq destination (point)))
      (end-of-buffer
       (signal (car x) (cdr x))))
    (when destination (goto-char destination))))

I initially misunderstood the requirements, but believe this updated function does the right thing and also corrects the bug the old function had at the beginning of the line:

(defun down-stantonly ()
  (interactive)
  (let ((goal-column (current-column))
        (some-non-ws-p
         (lambda ()
           (and (= (current-column) goal-column)
                (let ((pt (+ (if (eolp) 0 1) (point))))
                  (save-excursion
                    (beginning-of-line)
                    (re-search-forward "\\S-" pt t)))))))
    (while (funcall some-non-ws-p)
      (next-line))
    (while (not (funcall some-non-ws-p))
      (next-line))))

I initially misunderstood the requirements, but believe this updated function does the right thing and also corrects the bug the old function had at the beginning of the line:

EDIT: updated to only move the point when a suitable line is found:

(defun down-stantonly ()
  (interactive)
  (let (destination
        (goal-column (current-column))
        (some-non-ws-p
         (lambda ()
           (and (= (current-column) goal-column)
                (let ((pt (+ (if (eolp) 0 1) (point))))
                  (save-excursion
                    (beginning-of-line)
                    (re-search-forward "\\S-" pt t)))))))
    (condition-case x
        (save-excursion
          (while (funcall some-non-ws-p)
            (next-line))
          (while (not (funcall some-non-ws-p))
            (next-line))
          (setq destination (point)))
      (end-of-buffer
       (signal (car x) (cdr x))))
    (when destination (goto-char destination))))
2 added 317 characters in body
source | link

DoesI initially misunderstood the requirements, but believe this doupdated function does the job?right thing and also corrects the bug the old function had at the beginning of the line:

(defun down-stantonly ()
  (interactive)
  (let ((goal-column (current-column)))
        (nextsome-line)non-ws-p
         (whilelambda (or)
           (<and (= (current-column) goal-column)
                (let ((pt (+ (if (eolp) 0 1) (point))))
                  (save-excursion
                    (beginning-of-line)
                   (not (re-search-forward "\\S-" pt t)))))))
    (while (funcall some-non-ws-p)
      (next-line))
    (while (not (funcall some-non-ws-p))
      (next-line))))

Does this do the job?

(defun down-stantonly ()
  (interactive)
  (let ((goal-column (current-column)))
    (next-line)
    (while (or (< (current-column) goal-column)
               (let ((pt (point)))
                 (save-excursion
                   (beginning-of-line)
                   (not (re-search-forward "\\S-" pt t)))))
      (next-line))))

I initially misunderstood the requirements, but believe this updated function does the right thing and also corrects the bug the old function had at the beginning of the line:

(defun down-stantonly ()
  (interactive)
  (let ((goal-column (current-column))
        (some-non-ws-p
         (lambda ()
           (and (= (current-column) goal-column)
                (let ((pt (+ (if (eolp) 0 1) (point))))
                  (save-excursion
                    (beginning-of-line)
                    (re-search-forward "\\S-" pt t)))))))
    (while (funcall some-non-ws-p)
      (next-line))
    (while (not (funcall some-non-ws-p))
      (next-line))))
1
source | link

Does this do the job?

(defun down-stantonly ()
  (interactive)
  (let ((goal-column (current-column)))
    (next-line)
    (while (or (< (current-column) goal-column)
               (let ((pt (point)))
                 (save-excursion
                   (beginning-of-line)
                   (not (re-search-forward "\\S-" pt t)))))
      (next-line))))