Commit dc9cac28 authored by Troels Henriksen's avatar Troels Henriksen
Browse files

`(setf column-number)' now returns the column.

parent 53803855
...@@ -425,13 +425,17 @@ at the end of the buffer if no following newline character exists. Returns mark. ...@@ -425,13 +425,17 @@ at the end of the buffer if no following newline character exists. Returns mark.
(buffer-column-number (buffer mark) (offset mark))) (buffer-column-number (buffer mark) (offset mark)))
(defgeneric (setf column-number) (number mark) (defgeneric (setf column-number) (number mark)
(:documentation "Set the column number of the mark.")) (:documentation "Set the column number of the mark, return the
column number. Note that if `number' is larger than the length
of the line `mark' is in, `mark' will be moved to end of
line."))
(defmethod (setf column-number) (number mark) (defmethod (setf column-number) (number mark)
(beginning-of-line mark) (beginning-of-line mark)
(loop repeat number (loop repeat number
until (end-of-line-p mark) until (end-of-line-p mark)
do (incf (offset mark)))) do (incf (offset mark))
finally (return (column-number mark))))
(defgeneric insert-buffer-object (buffer offset object) (defgeneric insert-buffer-object (buffer offset object)
(:documentation "Insert the object at the offset in the buffer. Any left-sticky marks (:documentation "Insert the object at the offset in the buffer. Any left-sticky marks
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment