(defun gitmerge-get-sha1 ()
"Get SHA1 from commit at point."
(save-excursion
- (goto-char (point-at-bol))
+ (goto-char (line-beginning-position))
(when (looking-at "^[A-Z ]\\s-*\\([a-f0-9]+\\)")
(match-string 1))))
skip)
(when commit
(save-excursion
- (goto-char (point-at-bol))
+ (goto-char (line-beginning-position))
(when (looking-at "^\\([A-Z ]\\)\\s-*\\([a-f0-9]+\\)")
(setq skip (string= (match-string 1) " "))
(goto-char (match-beginning 2))
(dolist (ct gitmerge--commits)
(when (string-match commit (car ct))
(setcdr ct (when skip "M"))))
- (goto-char (point-at-bol))
+ (goto-char (line-beginning-position))
(setq buffer-read-only nil)
(delete-char 1)
(insert (if skip "M" " "))
(save-match-data
(save-excursion
(let* ((text-start allout-recent-prefix-end)
- (heading-end (point-at-eol)))
+ (heading-end (line-end-position)))
(goto-char text-start)
(setq file-name
(if (re-search-forward "\\s-\\(\\S-*\\)" heading-end t)
(interactive)
(save-excursion
(allout-back-to-heading)
- (if (allout-hidden-p (point-at-eol))
+ (if (allout-hidden-p (line-end-position))
(allout-show-current-subtree)
(allout-hide-current-subtree))))
;;;_ > allout-show-current-branches ()
(let ((inhibit-field-text-motion t))
(beginning-of-line)
(let (;(beg (point))
- (end (point-at-eol)))
+ (end (line-end-position)))
(save-match-data
(while (re-search-forward "\\\\"
;;"\\\\\\|\\{\\|\\}\\|\\_\\|\\$\\|\\\"\\|\\&\\|\\^\\|\\-\\|\\*\\|#"
(interactive)
(unless (eq major-mode 'calc-keypad-mode)
(error "Must be in *Calc Keypad* buffer for this command"))
- (let* ((row (count-lines (point-min) (point-at-bol)))
+ (let* ((row (count-lines (point-min) (line-beginning-position)))
(y (/ row 2))
(x (/ (current-column) (if (>= y 4) 6 5)))
radix frac inv
(let ((stuff (calc-top-list n (- num n -1))))
(calc-cursor-stack-index num)
(unless calc-kill-line-numbering
- (re-search-forward "\\=[0-9]+:\\s-+" (point-at-eol) t))
+ (re-search-forward "\\=[0-9]+:\\s-+" (line-end-position) t))
(let ((first (point)))
(calc-cursor-stack-index (- num n))
(if (null nn)
(setq single t)
(setq arg (prefix-numeric-value arg))
(if (= arg 0)
- (setq top (point-at-bol)
- bot (point-at-eol))
+ (setq top (line-beginning-position)
+ bot (line-end-position))
(save-excursion
(setq top (point))
(forward-line arg)
(goto-char (point-min))
(when (not (eobp))
(file-name-as-directory
- (buffer-substring (point) (point-at-eol)))))))
+ (buffer-substring (point) (line-end-position)))))))
(defun cedet-gnu-global-version-check (&optional noerror)
"Check the version of the installed GNU Global command.
(interactive)
(forward-line 1)
(beginning-of-line)
- (skip-chars-forward "- *><[]" (point-at-eol)))
+ (skip-chars-forward "- *><[]" (line-end-position)))
(defun data-debug-prev ()
"Go to the previous line in the Ddebug buffer."
(interactive)
(forward-line -1)
(beginning-of-line)
- (skip-chars-forward "- *><[]" (point-at-eol)))
+ (skip-chars-forward "- *><[]" (line-end-position)))
(defun data-debug-next-expando ()
"Go to the next line in the Ddebug buffer.
(data-debug-current-line-expanded-p))
(data-debug-contract-current-line)
(data-debug-expand-current-line))
- (skip-chars-forward "- *><[]" (point-at-eol)))
+ (skip-chars-forward "- *><[]" (line-end-position)))
(defun data-debug-expand-or-contract-mouse (event)
"Expand or contract anything at event EVENT."
(beginning-of-line)
(let* ((end-of-cmd
(save-excursion
- (if (re-search-forward "(" (point-at-eol) t)
+ (if (re-search-forward "(" (line-end-position) t)
(progn
(forward-char -1)
(forward-sexp 1)
(point))
;; Else, just return EOL.
- (point-at-eol))))
+ (line-end-position))))
(cnt 0))
(save-restriction
- (narrow-to-region (point-at-bol) end-of-cmd)
+ (narrow-to-region (line-beginning-position) end-of-cmd)
(condition-case nil
(progn
(down-list 1)
(down-list 1)
(re-search-forward ", ?" nil nil (1- index))
(let ((end (save-excursion
- (re-search-forward ",\\|)" (point-at-eol))
+ (re-search-forward ",\\|)" (line-end-position))
(forward-char -1)
(point))))
(setq autoconf-deleted-text (buffer-substring (point) end))
(cond ((eq (cdr sv) 'share)
;; This variable may be shared between multiple targets.
(if (re-search-backward (concat "\\$(" (car sv) ")")
- (point-at-bol) t)
+ (line-beginning-position) t)
;; If its already in the dist target, then skip it.
nil
(setq sv (car sv))))
(let ((path (match-string 1)))
(if (string= path "nil")
nil
- (delete-region (point-at-bol) (point-at-bol 2)))))))))
+ (delete-region (line-beginning-position)
+ (line-beginning-position 2)))))))))
;;;
;; Autoload generators
(goto-char (point-min))
(when (re-search-forward (concat "^" (regexp-quote var) "\\s-*=\\s-*")
nil t)
- (buffer-substring-no-properties (point) (point-at-eol)))))
+ (buffer-substring-no-properties (point) (line-end-position)))))
(defun project-am-extract-package-info (dir)
"Extract the package information for directory DIR."
(beginning-of-line)
(looking-at "^\\([0-9]+\\):")
(let ((depth (string-to-number (match-string 1))))
- (while (not (re-search-forward "[]] [^ ]" (point-at-eol) t))
+ (while (not (re-search-forward "[]] [^ ]" (line-end-position) t))
(re-search-backward (format "^%d:" (1- depth)))
(setq depth (1- depth)))
(speedbar-line-token))))
Optional argument FACE specifies the face to do the highlighting."
(save-excursion
(goto-char (or point (point)))
- (let ((start (point-at-bol))
+ (let ((start (line-beginning-position))
(end (save-excursion
(end-of-line)
(when (not (eobp))
(progn
(semantic-push-parser-warning
(format "Skip %s" (buffer-substring-no-properties
- (point-at-bol) (point-at-eol)))
- (point-at-bol) (point-at-eol))
+ (line-beginning-position) (line-end-position)))
+ (line-beginning-position) (line-end-position))
nil)
t)))
;; The if indicates to skip this preprocessor section
(let () ;; (pt nil)
- (semantic-push-parser-warning (format "Skip %s" (buffer-substring-no-properties (point-at-bol) (point-at-eol)))
- (point-at-bol) (point-at-eol))
+ (semantic-push-parser-warning (format "Skip %s" (buffer-substring-no-properties
+ (line-beginning-position)
+ (line-end-position)))
+ (line-beginning-position) (line-end-position))
(beginning-of-line)
;; (setq pt (point))
;; This skips only a section of a conditional. Once that section
(skip-chars-backward "\r\n\t")
;; If a grammar footer is found, skip it.
(re-search-backward "^;;;\\s-+\\S-+\\s-+ends here"
- (point-at-bol) t)
+ (line-beginning-position) t)
(skip-chars-backward "\r\n\t")
(point)))
"\n"))
(goto-char (overlay-start region))
(when (pos-visible-in-window-p
(point) (get-buffer-window (current-buffer) 'visible))
- (if (< (overlay-end region) (point-at-eol))
+ (if (< (overlay-end region) (line-end-position))
(pulse-momentary-highlight-overlay
region semantic-idle-symbol-highlight-face)
;; Not the same
(pulse-momentary-highlight-region
(overlay-start region)
- (point-at-eol)
+ (line-end-position)
semantic-idle-symbol-highlight-face))))
))
((vectorp region)
end t)
;; This is likely it, give it a try.
(pulse-momentary-highlight-region
- start (if (<= end (point-at-eol)) end
- (point-at-eol))
+ start (if (<= end (line-end-position)) end
+ (line-end-position))
semantic-idle-symbol-highlight-face)))
))))
nil))
(goto-char end)
(setq arg-parsed
(semantic-lex-spp-one-token-and-move-for-macro
- ;; NOTE: This used to be (point-at-eol), but
+ ;; NOTE: This used to be (line-end-position), but
;; that was too close for multi-line arguments
;; to a macro. Point max may be too far if there
;; is a typo in the buffer.
;; to work properly. Lets try and move over
;; whatever white space we matched to begin
;; with.
- (skip-syntax-forward "-.'" (point-at-eol))
+ (skip-syntax-forward "-.'" (line-end-position))
;; We may need to back up so newlines or whitespace is generated.
(if (bolp)
(backward-char 1)))
(when (re-search-forward (if (memq searchtype '(regexp tagregexp))
searchtxt
(regexp-quote searchtxt))
- (point-at-eol)
+ (line-end-position)
t)
(goto-char (match-beginning 0))
)
"Toggle showing the contents below the current line."
(interactive)
(beginning-of-line)
- (when (re-search-forward "\\[[-+]\\]" (point-at-eol) t)
+ (when (re-search-forward "\\[[-+]\\]" (line-end-position) t)
(forward-char -1)
(push-button)))
(forward-line (1- H))
(beginning-of-line)
(back-to-indentation)
- (setq text (cons (buffer-substring (point) (point-at-eol)) text)))
+ (setq text (cons (buffer-substring (point) (line-end-position)) text)))
(setq text (nreverse text)))
(goto-char (button-start button))
(forward-char 1)
(switch-to-buffer-other-window (semantic-tag-buffer tag))
(goto-char (point-min))
(forward-line (1- line))
- (when (not (re-search-forward (regexp-quote oldsym) (point-at-eol) t))
+ (when (not (re-search-forward (regexp-quote oldsym) (line-end-position) t))
(error "Cannot find hit. Cannot record macro"))
(goto-char (match-beginning 0))
;; Cursor is now in the right location. Start recording a macro.
(goto-char (point-min))
(forward-line (1- line))
(beginning-of-line)
- (while (re-search-forward (regexp-quote oldsym) (point-at-eol) t)
+ (while (re-search-forward (regexp-quote oldsym) (line-end-position) t)
(setq count (1+ count))
(save-excursion ;; Leave cursor after the matched name.
(goto-char (match-beginning 0)) ;; Go to beginning of that sym
(if noshow
""
(if semantic-stickyfunc-show-only-functions-p ""
- (buffer-substring (point-at-bol) (point-at-eol))
+ (buffer-substring (line-beginning-position) (line-end-position))
))
;; Go get the first line of this tag.
(goto-char (semantic-tag-start tag))
;; Without going to the tag-name we would get"void" in the
;; header line which is IMHO not really useful
(search-forward (semantic-tag-name tag) nil t)
- (buffer-substring (point-at-bol) (point-at-eol))
+ (buffer-substring (line-beginning-position) (line-end-position))
))))
(start 0))
(while (string-match "%" str start)
(goto-char (semantic-tag-start tag))
(search-forward (semantic-tag-name tag) nil t)
(overlay-put ol 'tag tag)
- (move-overlay ol (point-at-bol) (point-at-eol)))))))
+ (move-overlay ol (line-beginning-position) (line-end-position)))))))
nil)
(semantic-add-minor-mode 'semantic-highlight-func-mode
(when (looking-at "\\w\\|\\s_")
(forward-sexp 1))
(setq end (point))
- (unless (re-search-backward "\\s-" (point-at-bol) t)
+ (unless (re-search-backward "\\s-" (line-beginning-position) t)
(beginning-of-line))
(setq tmp (buffer-substring-no-properties (point) end))
;; (setq symlist
;; Find any existing doc strings.
(goto-char (semantic-tag-end var-in))
- (skip-syntax-forward "-" (point-at-eol))
+ (skip-syntax-forward "-" (line-end-position))
(let ((lextok (semantic-doc-snarf-comment-for-tag 'lex))
)
(end-of-line)
(delete-horizontal-space)
(move-to-column comment-column t)
- (when (< (point) (point-at-eol)) (end-of-line))
+ (when (< (point) (line-end-position)) (end-of-line))
;; Perform the insertion
(let ((srecode-semantic-selected-tag var-in)
"Does TAG fit on one line with space on the end?"
(save-excursion
(semantic-go-to-tag tag)
- (and (<= (semantic-tag-end tag) (point-at-eol))
+ (and (<= (semantic-tag-end tag) (line-end-position))
(goto-char (semantic-tag-end tag))
(< (current-column) 70))))
((eq (oref sti where) 'end)
;; If there is whitespace after pnt, then clear it out.
(when (looking-at "\\s-*$")
- (delete-region (point) (point-at-eol)))
+ (delete-region (point) (line-end-position)))
(when (not (eolp))
(princ "\n")))
)
(dired-goto-next-file)
;; Use point difference instead of `current-column', because
;; the former works when `dired-hide-details-mode' is enabled.
- (let* ((first (- (point) (point-at-bol)))
+ (let* ((first (- (point) (line-beginning-position)))
(target first))
(while (and (not (eobp))
(progn
(forward-line)
(dired-move-to-filename)))
- (when-let* ((distance (- (point) (point-at-bol)))
+ (when-let* ((distance (- (point) (line-beginning-position)))
(higher (> distance target)))
(setq target distance)))
(and (/= first target) target))))
(while (dired-move-to-filename)
;; Use point difference instead of `current-column', because
;; the former works when `dired-hide-details-mode' is enabled.
- (let ((distance (- target (- (point) (point-at-bol))))
+ (let ((distance (- target (- (point) (line-beginning-position))))
(inhibit-read-only t))
(unless (zerop distance)
(re-search-backward regexp nil t)
(goto-char (point-min))
(forward-line line)
(save-restriction
- (narrow-to-region (point) (point-at-eol))
+ (narrow-to-region (point) (line-end-position))
(while (not (eobp))
;; Put the 'region face on any characters on this line that
;; aren't already highlighted.
(begin (previous-single-property-change end 'backtrace-form
nil (point-min))))
(unless tag
- (when (or (= end (point-max)) (> end (point-at-eol)))
+ (when (or (= end (point-max)) (> end (line-end-position)))
(user-error "No form here to reformat"))
(goto-char end)
(setq pos end
(let (new-l new-c)
(save-excursion
(goto-char offset)
- (setq new-l (1+ (count-lines (point-min) (point-at-bol)))
+ (setq new-l (1+ (count-lines (point-min)
+ (line-beginning-position)))
new-c (1+ (current-column)))
(format "%d:%d:" new-l new-c))))
""))
(defun chart-zap-chars (n)
"Zap up to N chars without deleting EOLs."
(if (not (eobp))
- (if (< n (- (point-at-eol) (point)))
+ (if (< n (- (line-end-position) (point)))
(delete-char n)
- (delete-region (point) (point-at-eol)))))
+ (delete-region (point) (line-end-position)))))
(defun chart-display-label (label dir zone start end &optional face)
"Display LABEL in direction DIR in column/row ZONE between START and END.
(bottom (save-excursion (move-to-window-line bottom-margin) (point)))
(far (save-excursion
(goto-char bottom)
- (point-at-bol (1- height)))))
+ (line-beginning-position (1- height)))))
(ignore top far)
,@body))
(if (and (eolp) (not (bolp))) (forward-char -1))
(if (not (looking-at "[][(){}]"))
(setq anchor-point (point)))
- (setq beg-lim (point-at-bol)
- end-lim (point-at-eol))
+ (setq beg-lim (line-beginning-position)
+ end-lim (line-end-position))
(cond ((re-search-forward "[][(){}]" end-lim t)
(backward-char) )
((re-search-backward "[][(){}]" beg-lim t))
(delete-char -1)
(setq p (point))
(setq indent nil)))
- (setq bol (point-at-bol))
+ (setq bol (line-beginning-position))
(if (re-search-backward "[^ \t]" bol 1) (forward-char))
(delete-region (point) p)
(if indent
(goto-char pos)
(beginning-of-line)
(if (re-search-backward "[^ \t]" nil t)
- (setq s (point-at-bol)))
+ (setq s (line-beginning-position)))
(goto-char pos)
(forward-line 1)
(if (re-search-forward "[^ \t]" nil t)
'epa-key))
(setq keys (cons key keys))))
(nreverse keys)))
- (let ((key (get-text-property (point-at-bol) 'epa-key)))
+ (let ((key (get-text-property (line-beginning-position) 'epa-key)))
(if key
(list key)))))
(goto-char (match-end 0))
(backward-char)
(forward-sexp)
- (skip-syntax-forward "-" (point-at-eol))
+ (skip-syntax-forward "-" (line-end-position))
(list (cons 'program program)
- (cons 'version (buffer-substring (point) (point-at-eol)))))))
+ (cons 'version (buffer-substring (point) (line-end-position)))))))
;;;###autoload
(defun epg-configuration ()
"Return the text for the item on the current line."
(beginning-of-line)
(when (re-search-forward "[]>] " nil t)
- (buffer-substring-no-properties (point) (point-at-eol))))
+ (buffer-substring-no-properties (point) (line-end-position))))
(defun erc-speedbar-item-info ()
"Display information about the current buffer on the current line."
;; to the next line before inserting a stamp. It allows for
;; some margin of error if what is displayed on the line differs
;; from the number of characters on the line.
- (setq col (+ col (ceiling (/ (- col (- (point) (point-at-bol))) 1.6))))
+ (setq col (+ col (ceiling (/ (- col (- (point) (line-beginning-position))) 1.6))))
(if (< col pos)
(erc-insert-aligned string pos)
(newline)
(save-excursion
(re-search-backward (regexp-opt
(mapcar 'car preferred-suffix-rules))
- (point-at-bol)
+ (line-beginning-position)
t))
(push (cons "" (cdr (assoc (match-string 0) ; i.e. "(TeX-current-macro)"
preferred-suffix-rules)))
(concat (car rule) name (cdr rule)))
guess-rules)))
(when (< (point-min) (point-max))
- (buffer-substring (goto-char (point-min)) (point-at-eol))))))))
+ (buffer-substring (goto-char (point-min)) (line-end-position))))))))
(defun ffap-tex (name)
(ffap-tex-init)
font-lock-comment-delimiter-face)))
(if (looking-back (or font-lock-comment-end-skip
comment-end-skip)
- (point-at-bol) t)
+ (line-beginning-position) t)
(put-text-property (match-beginning 0) (point) 'face
font-lock-comment-delimiter-face))))
(< (point) end))
(gnus-message 1
"Overview buffer contains garbage `%s'."
(buffer-substring
- p (point-at-eol))))
+ p (line-end-position))))
((= cur prev-num)
(or backed-up
(setq backed-up (gnus-agent-backup-overview-buffer)))
(gnus-category-position-point)))
(defun gnus-category-name ()
- (or (intern (get-text-property (point-at-bol) 'gnus-category))
+ (or (intern (get-text-property (line-beginning-position) 'gnus-category))
(error "No category on the current line")))
(defun gnus-category-read ()
(cl-incf nov-entries-deleted)
- (let* ((from (point-at-bol))
+ (let* ((from (line-beginning-position))
(to (progn (forward-line 1) (point)))
(freed (- to from)))
(cl-incf bytes-freed freed)
(while (re-search-forward "^[^: \t]+:[ \t]*\n[^ \t]" nil t)
(forward-line -1)
(gnus-article-hide-text-type
- (point-at-bol)
+ (line-beginning-position)
(progn
(end-of-line)
(if (re-search-forward "^[^ \t]" nil t)
(goto-char (point-min))
(when (re-search-forward (concat "^" header ":") nil t)
(gnus-article-hide-text-type
- (point-at-bol)
+ (line-beginning-position)
(progn
(end-of-line)
(if (re-search-forward "^[^ \t]" nil t)
(article-narrow-to-head)
(while (not (eobp))
(cond
- ((< (setq column (- (point-at-eol) (point)))
+ ((< (setq column (- (line-end-position) (point)))
gnus-article-normalized-header-length)
(end-of-line)
(insert (make-string
(progn
(forward-char gnus-article-normalized-header-length)
(point))
- (point-at-eol)
+ (line-end-position)
'invisible t))
(t
;; Do nothing.
(end-of-line)
(when (>= (current-column) width)
(narrow-to-region (min (1+ (point)) (point-max))
- (point-at-bol))
+ (line-beginning-position))
(let ((goback (point-marker))
(fill-column width))
(fill-paragraph nil)
(while (and (not (bobp))
(looking-at "^[ \t]*$")
(not (gnus-annotation-in-region-p
- (point) (point-at-eol))))
+ (point) (line-end-position))))
(forward-line -1))
(forward-line 1)
(point))))))
'original-date)
bface (get-text-property (match-beginning 0) 'face)
eface (get-text-property (match-end 0) 'face))
- (delete-region (point-at-bol) (progn
- (gnus-article-forward-header)
- (point)))))
+ (delete-region (line-beginning-position)
+ (progn
+ (gnus-article-forward-header)
+ (point)))))
(when (and (not date)
visible-date)
(setq date visible-date))
(message-narrow-to-head)
(goto-char (point-max))
(forward-line -1)
- (setq bface (get-text-property (point-at-bol) 'face)
- eface (get-text-property (1- (point-at-eol)) 'face))
+ (setq bface (get-text-property (line-beginning-position) 'face)
+ eface (get-text-property (1- (line-end-position)) 'face))
(message-remove-header "X-Gnus-PGP-Verify")
(if (re-search-forward "^X-PGP-Sig:" nil t)
(forward-line)
;; Go to the displayed subpart, assuming this is
;; multipart/alternative.
(setq part start
- end (point-at-eol))
+ end (line-end-position))
(while (and (not handle)
part
(< part end)
"Read article specified by message-id around point."
(interactive nil gnus-article-mode)
(save-excursion
- (re-search-backward "[ \t]\\|^" (point-at-bol) t)
- (re-search-forward "<?news:<?\\|<" (point-at-eol) t)
- (if (re-search-forward "[^@ ]+@[^ \t>]+" (point-at-eol) t)
+ (re-search-backward "[ \t]\\|^" (line-beginning-position) t)
+ (re-search-forward "<?news:<?\\|<" (line-end-position) t)
+ (if (re-search-forward "[^@ ]+@[^ \t>]+" (line-end-position) t)
(let ((msg-id (concat "<" (match-string 0) ">")))
(set-buffer gnus-summary-buffer)
(gnus-summary-refer-article msg-id))
(goto-char start)
(string-match
"\\(?:\"\\|\\(<\\)\\)[\t ]*\\(?:url[\t ]*:[\t ]*\\)?\\'"
- (buffer-substring (point-at-bol) start)))
+ (buffer-substring (line-beginning-position) start)))
(progn
(setq url (list (buffer-substring start end))
delim (if (match-beginning 1) ">" "\""))
(let ((bmrk (gnus-bookmark-bmenu-bookmark)))
(setq gnus-bookmark-bmenu-hidden-bookmarks
(cons bmrk gnus-bookmark-bmenu-hidden-bookmarks))
- (let ((start (point-at-eol)))
+ (let ((start (line-end-position)))
(move-to-column gnus-bookmark-bmenu-file-column t)
;; Strip off `mouse-face' from the white spaces region.
(if (display-mouse-p)
"Kill from point to end of line.
If optional arg NEWLINE-TOO is non-nil, delete the newline too.
Does not affect the kill ring."
- (delete-region (point) (point-at-eol))
+ (delete-region (point) (line-end-position))
(if (and newline-too (looking-at "\n"))
(delete-char 1)))
(set-buffer cache-buf)
(if (search-forward (concat "\n" (int-to-string (car cached)) "\t")
nil t)
- (setq beg (point-at-bol)
+ (setq beg (line-beginning-position)
end (progn (end-of-line) (point)))
(setq beg nil))
(set-buffer nntp-server-buffer)
(goto-char (point-min))
(forward-line (1- number))
(when (re-search-forward gnus-cite-attribution-suffix
- (point-at-eol)
+ (line-end-position)
t)
(gnus-article-add-button (match-beginning 1) (match-end 1)
'gnus-cite-toggle prefix))
;; Each line.
(setq begin (point)
guess-limit (progn (skip-chars-forward "^> \t\r\n") (point))
- end (point-at-bol 2)
+ end (line-beginning-position 2)
start end)
(goto-char begin)
;; Ignore standard Supercite attribution prefix.
"[\t [:alnum:]]+")))
gnus-message-max-citation-depth))
(mlist (make-list (* (1+ gnus-message-max-citation-depth) 2) nil))
- (start (point-at-bol))
- (end (point-at-eol)))
+ (start (line-beginning-position))
+ (end (line-end-position)))
(setcar mlist start)
(setcar (cdr mlist) end)
(setcar (nthcdr (* cdepth 2) mlist) start)
(when (re-search-forward (concat "^" header ":") nil t)
(unless (eq (char-after) ? )
(insert " "))
- (setq value (buffer-substring (point) (point-at-eol)))
+ (setq value (buffer-substring (point) (line-end-position)))
(and (string-match "[ \t]*\\([^ \t]+\\)[ \t]*" value)
(setq value (match-string 1 value)))
(condition-case ()
(concat "^" (regexp-quote gnus-agent-target-move-group-header)
":") nil t)
(skip-syntax-forward "-")
- (setq move-to (buffer-substring (point) (point-at-eol)))
+ (setq move-to (buffer-substring (point) (line-end-position)))
(message-remove-header gnus-agent-target-move-group-header))
(goto-char (point-min))
(when (re-search-forward
(gnus-group-setup-buffer)
(gnus-update-format-specifications nil 'group 'group-mode)
(let ((case-fold-search nil)
- (props (text-properties-at (point-at-bol)))
+ (props (text-properties-at (line-beginning-position)))
(empty (= (point-min) (point-max)))
(group (gnus-group-group-name))
number)
(defun gnus-group-group-name ()
"Get the name of the newsgroup on the current line."
- (let ((group (get-text-property (point-at-bol) 'gnus-group)))
+ (let ((group (get-text-property (line-beginning-position) 'gnus-group)))
(cond ((stringp group) group)
(group (symbol-name group)))))
(defun gnus-group-group-level ()
"Get the level of the newsgroup on the current line."
- (get-text-property (point-at-bol) 'gnus-level))
+ (get-text-property (line-beginning-position) 'gnus-level))
(defun gnus-group-group-indentation ()
"Get the indentation of the newsgroup on the current line."
- (or (get-text-property (point-at-bol) 'gnus-indentation)
+ (or (get-text-property (line-beginning-position) 'gnus-indentation)
(and gnus-group-indentation-function
(funcall gnus-group-indentation-function))
""))
(defun gnus-group-group-unread ()
"Get the number of unread articles of the newsgroup on the current line."
- (get-text-property (point-at-bol) 'gnus-unread))
+ (get-text-property (line-beginning-position) 'gnus-unread))
(defun gnus-group-new-mail (group)
(if (nnmail-new-mail-p group)
(looking-at "[][\C-@-*,/;-@\\^`{-\C-?]")))
(prog1 t
(skip-chars-backward "^][\C-@-\t\v-*,/;-@\\^`{-\C-?"
- (point-at-bol))))
+ (line-beginning-position))))
(and (looking-at "[][\C-@-\t\v-*,/;-@\\^`{-\C-?]*$")
(prog1 t
(skip-chars-backward "][\C-@-\t\v-*,/;-@\\^`{-\C-?")
(skip-chars-backward "^][\C-@-\t\v-*,/;-@\\^`{-\C-?"
- (point-at-bol))))
+ (line-beginning-position))))
(string-match "\\`[][\C-@-\t\v-*,/;-@\\^`{-\C-?]*\\'"
- (buffer-substring (point-at-bol) (point))))
+ (buffer-substring (line-beginning-position) (point))))
(when (looking-at regexp)
(match-string 1))
(let (group distance)
distance (- (match-beginning 1) (match-beginning 0))))
(skip-chars-backward "][\C-@-\t\v-*,/;-@\\^`{-\C-?")
(skip-chars-backward "^][\C-@-\t\v-*,/;-@\\^`{-\C-?"
- (point-at-bol))
+ (line-beginning-position))
(if (looking-at regexp)
(if (and group (<= distance (- start (match-end 0))))
group
(count-lines
(progn
(goto-char begin)
- (point-at-bol))
+ (line-beginning-position))
(progn
(goto-char end)
- (point-at-bol))))))
+ (line-beginning-position))))))
(goto-char begin)
(beginning-of-line) ;Important when LINES < 1
(gnus-group-kill-group lines)))
(error 0)))
spec)))
(when (> len 0)
- (goto-char (point-at-eol))
+ (goto-char (line-end-position))
(insert (propertize
" " 'display
(cons 'space
(list :align-to (- (window-width) 1 len))))))
- (goto-char (point-at-eol))
- (setq point (point-at-eol))
+ (goto-char (line-end-position))
+ (setq point (line-end-position))
(dolist (image spec)
(unless (stringp image)
(goto-char point)
(unless (zerop level)
(gnus-tree-indent level)
(insert (cadr gnus-tree-parent-child-edges))
- (setq col (- (setq beg (point)) (point-at-bol) 1))
+ (setq col (- (setq beg (point)) (line-beginning-position) 1))
;; Draw "|" lines upwards.
(while (progn
(forward-line -1)
(defsubst gnus-tree-indent-vertical ()
(let ((len (- (* (1+ gnus-tree-node-length) gnus-tmp-indent)
- (- (point) (point-at-bol)))))
+ (- (point) (line-beginning-position)))))
(when (> len 0)
(insert (make-string len ? )))))
(reg " -> +")
(file (save-excursion
(end-of-line)
- (if (and (re-search-backward reg (point-at-bol) t)
- (re-search-forward reg (point-at-eol) t))
- (buffer-substring (point) (point-at-eol))
+ (if (and (re-search-backward reg (line-beginning-position) t)
+ (re-search-forward reg (line-end-position) t))
+ (buffer-substring (point) (line-end-position))
nil))))
(if (or (not file)
(string-match "\\<\\(non-file rule\\|A file\\)\\>" file)
(goto-char (point-min))
(if (= dmt ?e)
(while (funcall search-func match nil t)
- (and (= (point-at-bol)
+ (and (= (line-beginning-position)
(match-beginning 0))
(= (progn (end-of-line) (point))
(match-end 0))
(funcall search-func match nil t))
;; Is it really exact?
(and (eolp)
- (= (point-at-bol) (match-beginning 0))
+ (= (line-beginning-position) (match-beginning 0))
;; Yup.
(progn
(setq found (setq arts (get-text-property
(goto-char (point-min))
(while (and (not (eobp))
(search-forward match nil t))
- (when (and (= (point-at-bol) (match-beginning 0))
+ (when (and (= (line-beginning-position) (match-beginning 0))
(eolp))
(setq found (setq arts (get-text-property (point) 'articles)))
(if trace
hashtb))
(puthash
word
- (append (get-text-property (point-at-eol) 'articles) val)
+ (append (get-text-property (line-end-position) 'articles) val)
hashtb)))
;; Make all the ignorable words ignored.
(let ((ignored (append gnus-ignored-adaptive-words
(buffer-substring
(point)
(progn
- (re-search-forward ":" (point-at-eol) t)
+ (re-search-forward ":" (line-end-position) t)
(1- (point))))))
(value (gnus-search-query-return-string
(when (looking-at-p "[\"/]") t))))
(gnus-server-position-point))
(defun gnus-server-server-name ()
- (let ((server (get-text-property (point-at-bol) 'gnus-server)))
+ (let ((server (get-text-property (line-beginning-position) 'gnus-server)))
(and server (symbol-name server))))
(defun gnus-server-named-server ()
"Return a server name that matches one of the names returned by
`gnus-method-to-server'."
- (let ((server (get-text-property (point-at-bol) 'gnus-named-server)))
+ (let ((server (get-text-property (line-beginning-position) 'gnus-named-server)))
(and server (symbol-name server))))
(defalias 'gnus-server-position-point 'gnus-goto-colon)
(save-excursion
(beginning-of-line)
(let ((name (get-text-property (point) 'gnus-group)))
- (when (re-search-forward ": \\(.*\\)$" (point-at-eol) t)
+ (when (re-search-forward ": \\(.*\\)$" (line-end-position) t)
(concat (gnus-method-to-server-name gnus-browse-current-method) ":"
(or name
(match-string-no-properties 1)))))))
(unless (bolp) (forward-line 1))
(setq end (point))
(goto-char (match-beginning 0))
- (delete-region (point-at-bol) end))))
+ (delete-region (line-beginning-position) end))))
(goto-char (point-max))
;; Make sure that each dribble entry is a single line, so that
;; the "remove" code above works.
(unless ignore-errors
(gnus-message 3 "Warning - invalid active: %s"
(buffer-substring
- (point-at-bol) (point-at-eol))))))
+ (line-beginning-position) (line-end-position))))))
(forward-line 1)))))
(defun gnus-groups-to-gnus-format (method &optional hashtb real-active)
;; don't give a damn, frankly, my dear.
(concat gnus-newsrc-options
(buffer-substring
- (point-at-bol)
+ (line-beginning-position)
;; Options may continue on the next line.
(or (and (re-search-forward "^[^ \t]" nil 'move)
- (point-at-bol))
+ (line-beginning-position))
(point)))))
(forward-line -1))
(group
;; The line was buggy.
(setq group nil)
(gnus-error 3.1 "Mangled line: %s"
- (buffer-substring (point-at-bol)
- (point-at-eol))))
+ (buffer-substring (line-beginning-position)
+ (line-end-position))))
nil))
;; Skip past ", ". Spaces are invalid in these ranges, but
;; we allow them, because it's a common mistake to put a
(while (re-search-forward "[ \t]-n" nil t)
(setq eol
(or (save-excursion
- (and (re-search-forward "[ \t]-n" (point-at-eol) t)
+ (and (re-search-forward "[ \t]-n" (line-end-position) t)
(- (point) 2)))
- (point-at-eol)))
+ (line-end-position)))
;; Search for all "words"...
(while (re-search-forward "[^ \t,\n]+" eol t)
(if (eq (char-after (match-beginning 0)) ?!)
(let (config)
(goto-char (point-min))
(while (not (eobp))
- (when (eq (get-char-property (point-at-eol) 'invisible) 'gnus-sum)
+ (when (eq (get-char-property (line-end-position) 'invisible) 'gnus-sum)
(push (save-excursion (forward-line 0) (point)) config))
(forward-line 1))
config)))
(let (header)
;; overview: [num subject from date id refs chars lines misc]
(unwind-protect
- (narrow-to-region (point) (point-at-eol))
+ (narrow-to-region (point) (line-end-position))
(unless (eobp)
(forward-char))
(setq header (nnheader-parse-nov number))
(setq thread (list (car (gnus-id-to-thread id))))
;; Get the thread this article is part of.
(setq thread (gnus-remove-thread id)))
- (setq old-pos (point-at-bol))
+ (setq old-pos (line-beginning-position))
(setq current (save-excursion
(and (re-search-backward "[\r\n]" nil t)
(gnus-summary-article-number))))
(gnus-summary-show-thread)
(gnus-data-remove
number
- (- (point-at-bol)
+ (- (line-beginning-position)
(prog1
- (1+ (point-at-eol))
+ (1+ (line-end-position))
(gnus-delete-line)))))))
(defun gnus-sort-threads-recursive (threads func)
(looking-at "Xref:"))
(search-forward "\nXref:" nil t))
(goto-char (1+ (match-end 0)))
- (setq xref (buffer-substring (point) (point-at-eol)))
+ (setq xref (buffer-substring (point) (line-end-position)))
(setf (mail-header-xref headers) xref)))))))
(defun gnus-summary-insert-subject (id &optional old-header use-old-header)
(goto-char (gnus-data-pos d))
(gnus-data-remove
number
- (- (point-at-bol)
+ (- (line-beginning-position)
(prog1
- (1+ (point-at-eol))
+ (1+ (line-end-position))
(gnus-delete-line))))))
;; Remove list identifiers from subject.
(let ((gnus-newsgroup-headers (list header)))
(defun gnus-summary-update-mark (mark type)
(let ((forward (cdr (assq type gnus-summary-mark-positions)))
(inhibit-read-only t))
- (re-search-backward "[\n\r]" (point-at-bol) 'move-to-limit)
+ (re-search-backward "[\n\r]" (line-beginning-position) 'move-to-limit)
(when forward
(when (looking-at "\r")
(cl-incf forward))
Returns nil if no thread was there to be shown."
(interactive nil gnus-summary-mode)
(let* ((orig (point))
- (end (point-at-eol))
+ (end (line-end-position))
(end (or (gnus-summary--inv end) (gnus-summary--inv (1- end))))
;; Leave point at bol
(beg (progn (beginning-of-line) (if (bobp) (point) (1- (point)))))
;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
(when gnus-summary-selected-face
(save-excursion
- (let* ((beg (point-at-bol))
- (end (point-at-eol))
+ (let* ((beg (line-beginning-position))
+ (end (line-end-position))
;; Fix by Mike Dugan <dugan@bucrf16.bu.edu>.
(from (if (get-text-property beg 'mouse-face)
beg
(with-no-warnings ;See docstring of gnus-summary-highlight.
(defvar score) (defvar default) (defvar default-high) (defvar default-low)
(defvar mark) (defvar uncached))
- (let* ((beg (point-at-bol))
+ (let* ((beg (line-beginning-position))
(article (or (gnus-summary-article-number) gnus-current-article))
(score (or (cdr (assq article
gnus-newsgroup-scored))
(let ((face (funcall (gnus-summary-highlight-line-0))))
(unless (eq face (gnus-get-text-property-excluding-characters-with-faces beg 'face))
(gnus-put-text-property-excluding-characters-with-faces
- beg (1+ (point-at-eol)) 'face
+ beg (1+ (line-end-position)) 'face
(setq face (if (boundp face) (symbol-value face) face)))
(when gnus-summary-highlight-line-function
(funcall gnus-summary-highlight-line-function article face))))))
(insert "Mime-Version: 1.0\n")
(widen)
(when (search-forward "\n--" nil t)
- (let ((separator (buffer-substring (point) (point-at-eol))))
+ (let ((separator (buffer-substring (point) (line-end-position))))
(message-narrow-to-head)
(message-remove-header "Content-Type")
(goto-char (point-max))
(defun gnus-group-topic-name ()
"The name of the topic on the current line."
- (get-text-property (point-at-bol) 'gnus-topic))
+ (get-text-property (line-beginning-position) 'gnus-topic))
(defun gnus-group-topic-level ()
"The level of the topic on the current line."
- (get-text-property (point-at-bol) 'gnus-topic-level))
+ (get-text-property (line-beginning-position) 'gnus-topic-level))
(defun gnus-group-topic-unread ()
"The number of unread articles in topic on the current line."
- (get-text-property (point-at-bol) 'gnus-topic-unread))
+ (get-text-property (line-beginning-position) 'gnus-topic-unread))
(defun gnus-topic-unread (topic)
"Return the number of unread articles in TOPIC."
(defun gnus-topic-visible-p ()
"Return non-nil if the current topic is visible."
- (get-text-property (point-at-bol) 'gnus-topic-visible))
+ (get-text-property (line-beginning-position) 'gnus-topic-visible))
(defun gnus-topic-articles-in-topic (entries)
(let ((total 0)
(defun gnus-group-active-topic-p ()
"Say whether the current topic comes from the active topics."
- (get-text-property (point-at-bol) 'gnus-active))
+ (get-text-property (line-beginning-position) 'gnus-active))
(defun gnus-topic-find-groups (topic &optional level all lowest recursive)
"Return entries for all visible groups in TOPIC.
;; Delete the current line (and the next N lines).
(defmacro gnus-delete-line (&optional n)
- `(delete-region (point-at-bol)
+ `(delete-region (line-beginning-position)
(progn (forward-line ,(or n 1)) (point))))
(defun gnus-extract-address-components (from)
(defun gnus-goto-colon ()
(move-beginning-of-line 1)
- (let ((eol (point-at-eol)))
+ (let ((eol (line-end-position)))
(goto-char (or (text-property-any (point) eol 'gnus-position t)
(search-forward ":" eol t)
(point)))))
"Various"))))
(goto-char (point-min))
(when (re-search-forward "^Subject: ")
- (delete-region (point) (point-at-eol))
+ (delete-region (point) (line-end-position))
(insert subject))
(goto-char (point-min))
(when (re-search-forward "^From:")
- (delete-region (point) (point-at-eol))
+ (delete-region (point) (line-end-position))
(insert " " from))
(let ((message-forward-decoded-p t))
(message-forward post t))))
(unless (looking-at (concat gnus-uu-begin-string "\\|"
gnus-uu-end-string))
(when (not found)
- (setq length (- (point-at-eol) (point-at-bol))))
+ (setq length (- (line-end-position) (line-beginning-position))))
(setq found t)
(beginning-of-line)
(setq beg (point))
(goto-char (point-min))
(re-search-forward
(concat "^" (regexp-quote mail-header-separator) "$") nil t)
- (setq header (buffer-substring (point-min) (point-at-bol)))
+ (setq header (buffer-substring (point-min) (line-beginning-position)))
(goto-char (point-min))
(when gnus-uu-post-separate-description
(progn
(forward-line 1)
(if (re-search-forward "^[^ \n\t]" nil t)
- (point-at-bol)
+ (line-beginning-position)
(point-max))))
(goto-char (point-min)))
(save-excursion
(save-restriction
(widen)
- (let ((bound (+ (point-at-eol) 1)) case-fold-search)
+ (let ((bound (+ (line-end-position) 1)) case-fold-search)
(goto-char (point-min))
(not (search-forward (concat "\n" mail-header-separator "\n")
bound t))))))
(goto-char (point-max))
(if (not (re-search-backward message-signature-separator nil t))
t
- (setq sig-start (1+ (point-at-eol)))
+ (setq sig-start (1+ (line-end-position)))
(setq sig-end
(if (re-search-forward
"<#/?\\(multipart\\|part\\|external\\|mml\\)" nil t)
- (- (point-at-bol) 1)
+ (- (line-beginning-position) 1)
(point-max)))
(if (>= (count-lines sig-start sig-end) 5)
(if (message-gnksa-enable-p 'signature)
(forward-line -1)))
;; The value of this header was empty, so we clear
;; totally and insert the new value.
- (delete-region (point) (point-at-eol))
+ (delete-region (point) (line-end-position))
;; If the header is optional, and the header was
;; empty, we can't insert it anyway.
(unless optionalp
(or (eq (char-after) ?\s) (eq (char-after) ?\t)))
(beginning-of-line 0)))
(when (or (eq (char-after) ?\s) (eq (char-after) ?\t)
- (search-forward ":" (point-at-eol) t))
+ (search-forward ":" (line-end-position) t))
;; We are a bit more lacks than the RFC and allow any positive number of WSP
;; characters.
- (skip-chars-forward " \t" (point-at-eol))
+ (skip-chars-forward " \t" (line-end-position))
(point)))
(defun message-beginning-of-line (&optional n)
(autoload 'ecomplete-display-matches "ecomplete")
(defun message--in-tocc-p ()
- (and (memq (char-after (point-at-bol)) '(?C ?T ?\t ? ))
+ (and (memq (char-after (line-beginning-position)) '(?C ?T ?\t ? ))
(message-point-in-header-p)
(save-excursion
(beginning-of-line)
(while (re-search-forward
"^X-Gnus-Newsgroup:"
(save-excursion (search-forward "\n\n" nil t) (point)) t)
- (delete-region (point-at-bol) (progn (forward-line 1) (point))))
+ (delete-region (line-beginning-position) (progn (forward-line 1) (point))))
(setq result (eval accept-form t))
(kill-buffer (current-buffer))
result)
(defun nnbabyl-delete-mail (&optional force leave-delim)
;; Delete the current X-Gnus-Newsgroup line.
(unless force
- (delete-region (point-at-bol) (progn (forward-line 1) (point))))
+ (delete-region (line-beginning-position) (progn (forward-line 1) (point))))
;; Beginning of the article.
(save-excursion
(save-restriction
(while (re-search-forward "^X-Gnus-Newsgroup: \\([^ ]+\\) " nil t)
(if (gethash (setq id (match-string 1)) idents)
(progn
- (delete-region (point-at-bol) (progn (forward-line 1) (point)))
+ (delete-region (line-beginning-position)
+ (progn (forward-line 1) (point)))
(nnheader-message 7 "Moving %s..." id)
(nnbabyl-save-mail
(nnmail-article-group 'nnbabyl-active-number)))
(search-forward id nil t)) ; We find the ID.
;; And the id is in the fourth field.
(if (not (and (search-backward "\t" nil t 4)
- (not (search-backward"\t" (point-at-bol) t))))
+ (not (search-backward"\t" (line-beginning-position) t))))
(forward-line 1)
(beginning-of-line)
(setq found t)
(goto-char (match-end 0))
(setq num (string-to-number
(buffer-substring
- (point) (point-at-eol))))
+ (point) (line-end-position))))
(goto-char start)
(< num article)))
;; Check that we are before an article with a
(progn
(setq num (string-to-number
(buffer-substring
- (point) (point-at-eol))))
+ (point) (line-end-position))))
(> num article))
;; Discard any article numbers before the one we're
;; now looking at.
(if (search-forward (concat "\n" nnfolder-article-marker)
nil t)
(string-to-number (buffer-substring
- (point) (point-at-eol)))
+ (point) (line-end-position)))
-1))))))))
(deffoo nnfolder-request-group (group &optional server dont-check _info)
(defsubst nnheader-header-value ()
(skip-chars-forward " \t")
- (buffer-substring (point) (point-at-eol)))
+ (buffer-substring (point) (line-end-position)))
(autoload 'ietf-drums-unfold-fws "ietf-drums")
(autoload 'gnus-extract-message-id-from-in-reply-to "gnus-sum")
(defun nnheader-parse-nov (&optional number)
- (let ((eol (point-at-eol))
+ (let ((eol (line-end-position))
references in-reply-to x header)
(setq header
(make-full-mail-header
;; This is invalid, but not all articles have Message-IDs.
()
(mail-position-on-field "References")
- (let ((begin (point-at-bol))
+ (let ((begin (line-beginning-position))
(fill-column 78)
(fill-prefix "\t"))
(when references
(while (not (eobp))
(condition-case nil
(progn
- (narrow-to-region (point) (point-at-eol))
+ (narrow-to-region (point) (line-end-position))
(setq group (read buffer)
group
(cond ((symbolp group)
(while (not (eobp))
(unless (< (move-to-column nnmail-split-header-length-limit)
nnmail-split-header-length-limit)
- (delete-region (point) (point-at-eol)))
+ (delete-region (point) (line-end-position)))
(forward-line 1))
;; Allow washing.
(goto-char (point-min))
(skip-chars-forward "^\n\r\t")
(unless (looking-at "[\r\n]")
(forward-char 1)
- (buffer-substring (point) (point-at-eol)))))))
+ (buffer-substring (point) (line-end-position)))))))
;; Function for nnmail-split-fancy: look up all references in the
;; cache and if a match is found, return that group.
(gnus-group-get-parameter qualgroup 'folder)))
(progn
(replace-match cur)
- (delete-region cpoint (point-at-bol))
+ (delete-region cpoint (line-beginning-position))
(forward-line)
(setq cpoint (point)))
(forward-line)))
(search-forward id nil t)) ; We find the ID.
;; And the id is in the fourth field.
(if (not (and (search-backward "\t" nil t 4)
- (not (search-backward "\t" (point-at-bol) t))))
+ (not (search-backward "\t" (line-beginning-position) t))))
(forward-line 1)
(beginning-of-line)
(setq found t)
(nnheader-insert-nov headers)))
(defsubst nnml-header-value ()
- (buffer-substring (match-end 0) (point-at-eol)))
+ (buffer-substring (match-end 0) (line-end-position)))
(defun nnml-parse-head (chars &optional number)
"Parse the head of the current buffer."
(regexp-quote
(concat group ":" old-number-string))
"\\>")
- (point-at-eol) t))
+ (line-end-position) t))
(replace-match
(concat group ":" new-number-string)))
;; Save to the new file:
(regexp-quote
(concat group ":" old-number-string))
"\\>")
- (point-at-eol) t)
+ (line-end-position) t)
(replace-match
(concat "\\1" group ":" new-number-string))))))
;; 4/ Possibly remove the article from the backlog:
(goto-char pos)
(if (looking-at (regexp-quote command))
(delete-region pos (progn (forward-line 1)
- (point-at-bol)))))))
+ (line-beginning-position)))))))
(nnheader-report 'nntp "Couldn't open connection to %s."
nntp-address))))
(goto-char pos)
(if (looking-at (regexp-quote command))
(delete-region pos (progn (forward-line 1)
- (point-at-bol)))))))
+ (line-beginning-position)))))))
(nnheader-report 'nntp "Couldn't open connection to %s."
nntp-address))))
(with-current-buffer buffer
(goto-char pos)
(if (looking-at (regexp-quote command))
- (delete-region pos (progn (forward-line 1) (point-at-bol))))
+ (delete-region pos (progn (forward-line 1)
+ (line-beginning-position))))
)))
(nnheader-report 'nntp "Couldn't open connection to %s."
nntp-address))))
(looking-at
"[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t")
(goto-char (match-end 0))
- (unless (search-forward "\t" (point-at-eol) 'move)
+ (unless (search-forward "\t" (line-end-position) 'move)
(insert "\t"))
;; Remove any spaces at the beginning of the Xref field.
;; component server prefix.
(save-restriction
(narrow-to-region (point)
- (or (search-forward "\t" (point-at-eol) t)
- (point-at-eol)))
+ (or (search-forward "\t" (line-end-position) t)
+ (line-end-position)))
(goto-char (point-min))
(when (re-search-forward "Xref: *[^\n:0-9 ]+ *" nil t)
(replace-match "" t t))
(goto-char b)
(let (res)
(while (< (point) e)
- (let ((str (buffer-substring (point) (point-at-eol))))
+ (let ((str (buffer-substring (point) (line-end-position))))
(unless (string= "" str)
(push str res)))
(forward-line))
(goto-char (point-min))
(while (and (not (eobp))
(re-search-forward
- "http://\\([^/]+\\)\\(/.*\\) *$" (point-at-eol) t))
+ "http://\\([^/]+\\)\\(/.*\\) *$" (line-end-position) t))
(let ((spam-report-gmane-wait
(zerop (% (line-number-at-pos) spam-report-gmane-max-requests))))
(gnus-message 6 "Reporting %s%s..."
;; check the return now (we're back in the temp buffer)
(goto-char (point-min))
(if (not (eobp))
- (setq category (buffer-substring (point) (point-at-eol))))
+ (setq category (buffer-substring (point) (line-end-position))))
(when (not (zerop (length category))) ; we need a category here
(if spam-ifile-all-categories
(setq return category)
(with-temp-buffer
(insert-file-contents file)
(while (not (eobp))
- (setq address (buffer-substring (point) (point-at-eol)))
+ (setq address (buffer-substring (point) (line-end-position)))
(forward-line 1)
;; insert the e-mail address if detected, otherwise the raw data
(unless (zerop (length address))
(buffer-substring-no-properties
opoint (point)))))
(if delete
- (delete-region (point-at-bol) (point)))))
+ (delete-region (line-beginning-position) (point)))))
(if list
value
(and (not (string= value "")) value)))
(prog1
(buffer-substring-no-properties opoint (point))
(if delete
- (delete-region (point-at-bol) (1+ (point))))))))))))
+ (delete-region (line-beginning-position)
+ (1+ (point))))))))))))
\f
;; Parse a list of tokens separated by commas.
;; It runs from point to the end of the visible part of the buffer.
(let (p)
(save-excursion
(while (>= (current-column) fill-column)
- (while (and (search-backward "," (point-at-bol) 'move)
+ (while (and (search-backward "," (line-beginning-position) 'move)
(>= (current-column) (1- fill-column))
(setq p (point))))
(when (or (not (bolp))
(delete-char 1))))
(message "folder %s spool %s" folder-name spool-name)
- (forward-line (if (eq (count-lines (point-min) (point-at-eol))
+ (forward-line (if (eq (count-lines (point-min) (line-end-position))
mspools-files-len)
;; FIXME: Why use `mspools-files-len' instead
;; of looking if we're on the last line and
(defun mspools-get-spool-name ()
"Return the name of the spool on the current line."
- (let ((line-num (1- (count-lines (point-min) (point-at-eol)))))
+ (let ((line-num (1- (count-lines (point-min) (line-end-position)))))
;; FIXME: Why not extract the name directly from the current line's text?
(car (nth line-num mspools-files))))
(progn
(forward-line 1)
(if (re-search-forward "^[^ \n\t]" nil t)
- (point-at-bol)
+ (line-beginning-position)
(point-max))))
(goto-char (point-min)))
(goto-char b)
(setq b (point-marker)
e (set-marker (make-marker) e))
- (rfc2047-fold-region (point-at-bol) b)
+ (rfc2047-fold-region (line-beginning-position) b)
(goto-char b)
(skip-chars-backward "^ \t\n")
(unless (= 0 (skip-chars-backward " \t"))
;; `crest' may contain whitespace and an open parenthesis.
(setq crest (buffer-substring-no-properties (point) b)))
(setq eword (rfc2047-encode-1
- (- b (point-at-bol))
+ (- b (line-beginning-position))
(replace-regexp-in-string
"\n\\([ \t]?\\)" "\\1"
(buffer-substring-no-properties b e))
(goto-char (point-min))
(let ((bol (save-restriction
(widen)
- (point-at-bol)))
- (eol (point-at-eol)))
+ (line-beginning-position)))
+ (eol (line-end-position)))
(forward-line 1)
(while (not (eobp))
(if (and (looking-at "[ \t]")
- (< (- (point-at-eol) bol) 76))
+ (< (- (line-end-position) bol) 76))
(delete-region eol (progn
(goto-char eol)
(skip-chars-forward "\r\n")
(point)))
- (setq bol (point-at-bol)))
- (setq eol (point-at-eol))
+ (setq bol (line-beginning-position)))
+ (setq eol (line-end-position))
(forward-line 1)))))
(defun rfc2047-b-encode-string (string)
;; should override any specified in the message itself.
(when where-content-type
(goto-char where-content-type)
- (delete-region (point-at-bol)
+ (delete-region (line-beginning-position)
(progn (forward-line 1) (point)))))))
;; Insert an extra newline if we need it to work around
;; Sun's bug that swallows newlines.
(smtpmail--sanitize-error-message result))))))
(delete-file file-data)
(delete-file file-elisp)
- (delete-region (point-at-bol) (point-at-bol 2)))
+ (delete-region (line-beginning-position) (line-beginning-position 2)))
(write-region (point-min) (point-max) qfile))))
(defun smtpmail--sanitize-error-message (string)
(while data-continue
(with-current-buffer buffer
(progress-reporter-update pr (point))
- (setq sending-data (buffer-substring (point-at-bol) (point-at-eol)))
+ (setq sending-data (buffer-substring (line-beginning-position)
+ (line-end-position)))
(end-of-line 2)
(setq data-continue (not (eobp))))
(smtpmail-send-data-1 process sending-data))
"Return a list of message numbers from point to the end of the line.
Expands ranges into set of individual numbers."
(let ((msgs ())
- (end-of-line (point-at-eol))
+ (end-of-line (line-end-position))
num)
(while (re-search-forward "[0-9]+" end-of-line t)
(setq num (string-to-number (buffer-substring (match-beginning 0)
(let* ((end (point))
(beg (save-excursion
(if (re-search-backward "\\([:,]\\|^\\)[ \t]*"
- (point-at-bol) 'move)
+ (line-beginning-position) 'move)
(goto-char (match-end 0)))
(point)))
(query-words (split-string (buffer-substring-no-properties beg end)
;; next line for Courier IMAP bug.
(skip-chars-forward " ")
(point)))
- (> (skip-chars-forward "^ )" (point-at-eol)) 0))
+ (> (skip-chars-forward "^ )" (line-end-position)) 0))
(push (buffer-substring start (point)) flag-list))
(cl-assert (eq (char-after) ?\)) nil "In imap-parse-flag-list 2")
(imap-forward)
(while (progn
(skip-chars-forward " \t\n")
(not (eobp)))
- (setq dn (buffer-substring (point) (point-at-eol)))
+ (setq dn (buffer-substring (point) (line-end-position)))
(forward-line 1)
(while (looking-at "^\\([A-Za-z][-A-Za-z0-9]*\
\\|[0-9]+\\(?:\\.[0-9]+\\)*\\)\\(;[-A-Za-z0-9]+\\)*[=:\t ]+\
(let ((inhibit-read-only t))
(goto-char (point-min))
(while (not (eobp))
- (let* ((pos (point-at-eol))
+ (let* ((pos (line-end-position))
(item (get-text-property (point) :nt-item))
(age (newsticker--age item))
(selected (get-text-property (point) :nt-selected))
(newsticker--treeview-list-clear-highlight)
(with-current-buffer (newsticker--treeview-list-buffer)
(let ((inhibit-read-only t))
- (put-text-property (point-at-bol) (point-at-eol) :nt-selected t))
+ (put-text-property (line-beginning-position) (line-end-position)
+ :nt-selected t))
(newsticker--treeview-list-update-faces)))
(defun newsticker--treeview-list-highlight-start ()
(with-current-buffer (newsticker--treeview-tree-buffer)
(goto-char pos)
(move-overlay newsticker--tree-selection-overlay
- (point-at-bol) (1+ (point-at-eol))
+ (line-beginning-position) (1+ (line-end-position))
(current-buffer)))
(if (window-live-p (newsticker--treeview-tree-window))
(set-window-point (newsticker--treeview-tree-window) pos)))))
(delete-char -3)
(if (eq (char-before) ?\))
(insert ")\n ")
- (goto-char (1+ (point-at-bol)))
+ (goto-char (1+ (line-beginning-position)))
(delete-region (point) (point-max)))))
(when (eq (char-before) ? )
(delete-char -2))
(goto-char (point-max))
(when (not (equal 0 (- (point) rcirc-prompt-end-marker)))
;; delete a trailing newline
- (when (eq (point) (point-at-bol))
+ (when (eq (point) (line-beginning-position))
(delete-char -1))
(let ((input (buffer-substring-no-properties
rcirc-prompt-end-marker (point))))
(let ((inhibit-read-only t))
(goto-char (point-min))
;; ADB terminal sends "^H" sequences.
- (when (re-search-forward "<\b+" (point-at-eol) t)
+ (when (re-search-forward "<\b+" (line-end-position) t)
(forward-line 1)
(delete-region (point-min) (point)))
;; Delete the prompt.
(goto-char (point-min))
- (when (re-search-forward prompt (point-at-eol) t)
+ (when (re-search-forward prompt (line-end-position) t)
(forward-line 1)
(delete-region (point-min) (point)))
(when (tramp-search-regexp prompt)
(setq buffer-read-only nil)
(goto-char (point-min))
(while (not (eobp))
- (if (re-search-forward tramp-buf-regexp (point-at-eol) t)
+ (if (re-search-forward tramp-buf-regexp (line-end-position) t)
(forward-line 1)
(forward-line 0)
(let ((start (point)))
(if (eq op 'encrypt) "Encoding" "Decoding") name))
(with-current-buffer (tramp-get-connection-buffer crypt-vec)
(goto-char (point-min))
- (buffer-substring (point-min) (point-at-eol)))))))
+ (buffer-substring (point-min) (line-end-position)))))))
;; Nothing to do.
name))
(tramp-shell-quote-argument localname)))
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
- (buffer-substring (point-min) (point-at-eol))))
+ (buffer-substring (point-min) (line-end-position))))
;; Use Perl implementation.
((and (tramp-get-remote-perl v)
(setq res-symlink-target
(if (looking-at-p "\"")
(read (current-buffer))
- (buffer-substring (point) (point-at-eol)))))
+ (buffer-substring (point) (line-end-position)))))
(forward-line)
;; ... file mode flags
(read (current-buffer))
(format "%s -ild %s"
(tramp-get-ls-command v)
(tramp-shell-quote-argument localname)))
- (setq attr (buffer-substring (point) (point-at-eol))))
+ (setq attr (buffer-substring (point) (line-end-position))))
(tramp-set-file-property
v localname "visited-file-modtime-ild" attr))
(setq last-coding-system-used coding-system-used)
(tramp-get-ls-command v)
(tramp-shell-quote-argument localname)))
(with-current-buffer (tramp-get-buffer v)
- (setq attr (buffer-substring (point) (point-at-eol))))
+ (setq attr (buffer-substring (point) (line-end-position))))
(equal
attr
(tramp-get-file-property
(concat "~" (or user (tramp-file-name-user vec))))))
(with-current-buffer (tramp-get-buffer vec)
(goto-char (point-min))
- (buffer-substring (point) (point-at-eol)))))
+ (buffer-substring (point) (line-end-position)))))
(defun tramp-sh-handle-get-remote-uid (vec id-format)
"The uid of the remote connection VEC, in ID-FORMAT.
(tramp-shell-quote-argument localname))))
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
- (when (re-search-forward regexp (point-at-eol) t)
+ (when (re-search-forward regexp (line-end-position) t)
(setq context (list (match-string 1) (match-string 2)
(match-string 3) (match-string 4))))))
;; Return the context.
(tramp-error
v 'file-error
"tramp-sh-handle-file-name-all-completions: %s"
- (buffer-substring (point) (point-at-eol))))
+ (buffer-substring (point) (line-end-position))))
;; For peace of mind, if buffer doesn't end in `fail'
;; then it should end in `ok'. If neither are in the
;; buffer something went seriously wrong on the remote
(tramp-shell-quote-argument localname) (buffer-string))))
(while (zerop (forward-line -1))
- (push (buffer-substring (point) (point-at-eol)) result)))
+ (push (buffer-substring (point) (line-end-position)) result)))
result))))))
;; cp, mv and ln
(tramp-shell-quote-argument (format "kill -%d $$" i))))
(with-current-buffer (tramp-get-connection-buffer vec)
(goto-char (point-min))
- (buffer-substring (point-at-bol) (point-at-eol)))))
+ (buffer-substring (line-beginning-position)
+ (line-end-position)))))
(if (string-empty-p res)
(format "Signal %d" i)
res)))
(when (search-backward "tramp_executable " nil t)
(skip-chars-forward "^ ")
(skip-chars-forward " ")
- (setq result (buffer-substring (point) (point-at-eol)))))
- result)))
+ (setq result (buffer-substring (point) (line-end-position)))))
+ result)))
;; On hydra.nixos.org, the $PATH environment variable is too long to
;; send it. This is likely not due to PATH_MAX, but PIPE_BUF. We
;; A simple-minded busybox has sent " ^H" sequences.
;; Delete them.
(goto-char (point-min))
- (when (re-search-forward "^\\(.\b\\)+$" (point-at-eol) t)
+ (when (re-search-forward "^\\(.\b\\)+$" (line-end-position) t)
(forward-line 1)
(delete-region (point-min) (point)))
;; Delete the prompt.
(unless noerror signal-hook-function)))
(read (current-buffer)))
;; Error handling.
- (when (re-search-forward "\\S-" (point-at-eol) t)
+ (when (re-search-forward "\\S-" (line-end-position) t)
(error nil)))
(error (unless noerror
(tramp-error
are listed. Result is the list (LOCALNAME MODE SIZE MTIME)."
;; We are called from `tramp-smb-get-file-entries', which sets the
;; current buffer.
- (let ((line (buffer-substring (point) (point-at-eol)))
+ (let ((line (buffer-substring (point) (line-end-position)))
localname mode size month day hour min sec year mtime)
(if (not share)
(member
"pathnames"
(split-string
- (buffer-substring (point) (point-at-eol)) nil 'omit)))))))))
+ (buffer-substring (point) (line-end-position)) nil 'omit)))))))))
(defun tramp-smb-get-stat-capability (vec)
"Check whether the SMB server supports the `stat' command."
(progn
;; Read the expression.
(goto-char (point-min))
- (buffer-substring (point) (point-at-eol)))
+ (buffer-substring (point) (line-end-position)))
":" 'omit))))
;; The equivalent to `exec-directory'.
`(,(tramp-file-local-name (expand-file-name default-directory)))))
(tramp-compat-file-name-unquote localname)))
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
- (when (re-search-forward regexp (point-at-eol) t)
+ (when (re-search-forward regexp (line-end-position) t)
(setq context (list (match-string 1) (match-string 2)
(match-string 3) (match-string 4))))))
;; Return the context.
(delete-region (point-min) (point))
;; Delete empty lines.
(goto-char (point-min))
- (while (and (not (eobp)) (= (point) (point-at-eol)))
+ (while (and (not (eobp)) (= (point) (line-end-position)))
(forward-line))
(delete-region (point-min) (point))
(tramp-message vec 3 "Process has finished.")
(condition-case nil
(prog1 (read (current-buffer))
;; Error handling.
- (when (re-search-forward "\\S-" (point-at-eol) t)
+ (when (re-search-forward "\\S-" (line-end-position) t)
(error nil)))
(error (tramp-error
vec 'file-error
"Return a (user host) tuple allowed to access.
User is always nil."
(let (result)
- (when (re-search-forward regexp (point-at-eol) t)
+ (when (re-search-forward regexp (line-end-position) t)
(setq result (list nil (match-string match-level))))
(or
(> (skip-chars-forward skip-chars) 0)
(concat
"^\\(" tramp-host-regexp "\\)"
"\\([ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?")))
- (when (re-search-forward regexp (point-at-eol) t)
+ (when (re-search-forward regexp (line-end-position) t)
(setq result (append (list (match-string 3) (match-string 1)))))
(forward-line 1)
result))
Host is always \"localhost\"."
(let (result
(regexp (concat "^\\(" tramp-user-regexp "\\):")))
- (when (re-search-forward regexp (point-at-eol) t)
+ (when (re-search-forward regexp (line-end-position) t)
(setq result (list (match-string 1) "localhost")))
(forward-line 1)
result))
"Return a (group host) tuple allowed to access.
Host is always \"localhost\"."
(let (result
- (split (split-string (buffer-substring (point) (point-at-eol)) ":")))
+ (split (split-string (buffer-substring (point) (line-end-position)) ":")))
(when (member (user-login-name) (split-string (nth 3 split) "," 'omit))
(setq result (list (nth 0 split) "localhost")))
(forward-line 1)
User is always nil."
(let (result
(regexp (concat (regexp-quote registry) "\\\\\\(.+\\)")))
- (when (re-search-forward regexp (point-at-eol) t)
+ (when (re-search-forward regexp (line-end-position) t)
(setq result (list nil (match-string 1))))
(forward-line 1)
result))
(goto-char (point-min))
(while (setq start
(text-property-not-all
- (point) (point-at-eol) 'dired-filename t))
+ (point) (line-end-position) 'dired-filename t))
(delete-region
start
- (or (text-property-any start (point-at-eol) 'dired-filename t)
- (point-at-eol)))
- (if (= (point-at-bol) (point-at-eol))
+ (or (text-property-any start (line-end-position) 'dired-filename t)
+ (line-end-position)))
+ (if (= (line-beginning-position) (line-end-position))
;; Empty line.
(delete-region (point) (progn (forward-line) (point)))
(forward-line)))))))))
(goto-char (point-min))
;; Go through the file, line by line.
(while (not (eobp))
- (narrow-to-region (point) (point-at-eol))
+ (narrow-to-region (point) (line-end-position))
;; For each line, get the tokens and values.
(while (not (eobp))
(skip-chars-forward "\t ")
(with-temp-buffer
(insert-file-contents netrc-services-file)
(while (search-forward "#" nil t)
- (delete-region (1- (point)) (point-at-eol)))
+ (delete-region (1- (point)) (line-end-position)))
(goto-char (point-min))
(while (re-search-forward
"^ *\\([^ \n\t]+\\)[ \t]+\\([0-9]+\\)/\\([^ \t\n]+\\)" nil t)
(bottom (save-excursion (move-to-window-line bottom-margin) (point)))
(far (save-excursion
(goto-char bottom)
- (point-at-bol (1- height)))))
+ (line-beginning-position (1- height)))))
,@body))
(defun tpu-paragraph (num)
vals ""))))))
(save-excursion
(goto-char begin)
- (goto-char (point-at-eol))
+ (goto-char (line-end-position))
(unless (= (char-before (point)) ?\ ) (insert " "))
(insert ":" header-arg) (when value (insert " " value)))))
(let ((lang (nth 0 info))
(indent (make-string (current-indentation) ?\s)))
(when (string-match "^[[:space:]]*$"
- (buffer-substring (point-at-bol)
- (point-at-eol)))
- (delete-region (point-at-bol) (point-at-eol)))
+ (buffer-substring (line-beginning-position)
+ (line-end-position)))
+ (delete-region (line-beginning-position) (line-end-position)))
(insert (concat
(if (looking-at "^") "" "\n")
indent (if upper-case-p "#+END_SRC\n" "#+end_src\n")
(progn
(goto-char (point-min))
(forward-line (- lineNo 1))
- (buffer-substring (point) (point-at-eol)))
+ (buffer-substring (point) (line-end-position)))
nil)))
(defun org-babel-lilypond-attempt-to-open-pdf (file-name &optional test)
(insert-file-contents file-name)
(re-search-forward "^[ \t]*[^# \t]" nil t)
(when (< (setq beg (point-min))
- (setq end (point-at-bol)))
+ (setq end (line-beginning-position)))
(delete-region beg end)))
(org-babel-import-elisp-from-file temp-file '(16))))
;; can we get a '::' part?
(if (string= erc-line (erc-prompt))
(progn
- (goto-char (point-at-bol))
+ (goto-char (line-beginning-position))
(when (search-backward-regexp "^[^ ]" nil t)
- (buffer-substring-no-properties (point-at-bol)
- (point-at-eol))))
+ (buffer-substring-no-properties (line-beginning-position)
+ (line-end-position))))
(when (search-backward erc-line nil t)
- (buffer-substring-no-properties (point-at-bol)
- (point-at-eol)))))))
+ (buffer-substring-no-properties (line-beginning-position)
+ (line-end-position)))))))
(defun org-irc-erc-store-link ()
"Store a link to the IRC log file or the session itself.
(require 'erc-log)
(if org-irc-link-to-logs
(let* ((erc-line (buffer-substring-no-properties
- (point-at-bol) (point-at-eol)))
+ (line-beginning-position) (line-end-position)))
(parsed-line (org-irc-erc-get-line-from-log erc-line)))
(if (erc-logging-enabled nil)
(progn
(let ((end (region-end)))
(goto-char (region-beginning))
(set-mark (point))
- (while (< (point-at-eol) end)
+ (while (< (line-end-position) end)
(move-end-of-line 1) (activate-mark)
(let (current-prefix-arg)
(call-interactively 'org-store-link))
of the current line."
(declare (debug t))
(org-with-gensyms (marker)
- `(let ((,marker (get-text-property (if ,string 0 (point-at-bol))
+ `(let ((,marker (get-text-property (if ,string 0 (line-beginning-position))
'org-hd-marker ,string)))
(with-current-buffer (marker-buffer ,marker)
(save-excursion
(when (eq rmheader t)
(org-goto-line 1)
(re-search-forward ":" nil t)
- (delete-region (match-end 0) (point-at-eol))
+ (delete-region (match-end 0) (line-end-position))
(forward-char 1)
(looking-at "-+")
- (delete-region (match-end 0) (point-at-eol))
+ (delete-region (match-end 0) (line-end-position))
(move-marker header-end (match-end 0)))
(goto-char header-end)
(delete-region (point) (point-max))
"Mark the line at POS as an agenda structure header."
(save-excursion
(goto-char pos)
- (put-text-property (point-at-bol) (point-at-eol)
+ (put-text-property (line-beginning-position) (line-end-position)
'org-agenda-structural-header t)
(when org-agenda-title-append
- (put-text-property (point-at-bol) (point-at-eol)
+ (put-text-property (line-beginning-position) (line-end-position)
'org-agenda-title-append org-agenda-title-append))))
(defvar org-mobile-creating-agendas) ; defined in org-mobile.el
(while (not (eobp))
(unless (looking-at "[ \t]*$")
(move-to-column ind)
- (delete-region (point-at-bol) (point)))
+ (delete-region (line-beginning-position) (point)))
(beginning-of-line 2))
(run-hooks 'org-agenda-entry-text-cleanup-hook)
(goto-char (point-min))
(while (equal (forward-line) 0)
(when (setq mrk (get-text-property (point) 'org-hd-marker))
- (put-text-property (point-at-bol) (point-at-eol)
+ (put-text-property (line-beginning-position) (line-end-position)
'tags
(org-with-point-at mrk
(org-get-tags))))))))
(goto-char s)
(when (equal (org-get-at-bol 'org-hd-marker)
org-clock-hd-marker)
- (setq ov (make-overlay (point-at-bol) (1+ (point-at-eol))))
+ (setq ov (make-overlay (line-beginning-position)
+ (1+ (line-end-position))))
(overlay-put ov 'type 'org-agenda-clocking)
(overlay-put ov 'face 'org-agenda-clocking)
(overlay-put ov 'help-echo
b (match-beginning 1)
e (if (eq org-agenda-fontify-priorities 'cookies)
(1+ (match-end 2))
- (point-at-eol))
+ (line-end-position))
ov (make-overlay b e))
(overlay-put
ov 'face
"Throw to `:skip' in places that should be skipped.
Also moves point to the end of the skipped region, so that search can
continue from there."
- (let ((p (point-at-bol)) to)
+ (let ((p (line-beginning-position)) to)
(when (or
(save-excursion (goto-char p) (looking-at comment-start-skip))
(and org-agenda-skip-archived-trees (not org-agenda-archives-mode)
m org-agenda-entry-text-maxlines
org-agenda-entry-text-leaders))))
(when (string-match "\\S-" txt)
- (setq o (make-overlay (point-at-bol) (point-at-eol)))
+ (setq o (make-overlay (line-beginning-position) (line-end-position)))
(overlay-put o 'evaporate t)
(overlay-put o 'org-overlay-type 'agenda-entry-content)
(overlay-put o 'after-string txt))))
(forward-line -1)
(org-back-to-heading t)))
(skip-chars-forward "* ")
- (setq beg (point-at-bol)
+ (setq beg (line-beginning-position)
beg1 (point)
end (progn
(outline-next-heading)
(goto-char beg)
(org-agenda-skip)
(setq str (buffer-substring-no-properties
- (point-at-bol)
- (if hdl-only (point-at-eol) end)))
+ (line-beginning-position)
+ (if hdl-only (line-end-position) end)))
(mapc (lambda (wr) (when (string-match wr str)
(goto-char (1- end))
(throw :skip t)))
txt (org-agenda-format-item
""
(buffer-substring-no-properties
- beg1 (point-at-eol))
+ beg1 (line-end-position))
level category tags t))
(org-add-props txt props
'org-marker marker 'org-hd-marker marker
(abbreviate-file-name buffer-file-name))
"")
'org-agenda-diary-link t
- 'org-marker (org-agenda-new-marker (point-at-bol))))
+ 'org-marker (org-agenda-new-marker (line-beginning-position))))
(defun org-diary-default-entry ()
"Add a dummy entry to the diary.
clockp (not (or closedp statep))
state (and statep (match-string 2))
category (org-get-category (match-beginning 0))
- timestr (buffer-substring (match-beginning 0) (point-at-eol)))
+ timestr (buffer-substring (match-beginning 0) (line-end-position)))
(when (string-match "\\]" timestr)
;; substring should only run to end of time stamp
(setq rest (substring timestr (match-end 0))
'type type 'date date
'undone-face 'org-warning 'done-face 'org-agenda-done)
(push txt ee))
- (goto-char (point-at-eol))))
+ (goto-char (line-end-position))))
(nreverse ee)))
(defun org-agenda-show-clocking-issues ()
(setq issue "No valid clock line") (throw 'next t))
(org-with-point-at m
(save-excursion
- (goto-char (point-at-bol))
+ (goto-char (line-beginning-position))
(unless (looking-at re)
(error "No valid Clock line")
(throw 'next t))
(setq tlend (or te tlend) tlstart (or ts tlstart))
(when issue
;; OK, there was some issue, add an overlay to show the issue
- (setq ov (make-overlay (point-at-bol) (point-at-eol)))
+ (setq ov (make-overlay (line-beginning-position) (line-end-position)))
(overlay-put ov 'before-string
(concat
(org-add-props
(save-excursion
(beginning-of-line 1)
(setq re (org-get-at-bol 'org-todo-regexp))
- (goto-char (or (text-property-any (point-at-bol) (point-at-eol) 'org-heading t) (point)))
+ (goto-char (or (text-property-any (line-beginning-position)
+ (line-end-position)
+ 'org-heading t)
+ (point)))
(when (looking-at (concat "[ \t]*\\.*\\(" re "\\) +"))
(add-text-properties (match-beginning 0) (match-end 1)
(list 'face (org-get-todo-face 1)))
(point)
(if org-agenda-restriction-lock-highlight-subtree
(save-excursion (org-end-of-subtree t t) (point))
- (point-at-eol)))
+ (line-end-position)))
(move-marker org-agenda-restrict-begin (point))
(move-marker org-agenda-restrict-end
(save-excursion (org-end-of-subtree t t)))
(defun org-agenda-filter-hide-line (type)
"If current line is TYPE, hide it in the agenda buffer."
(let* (buffer-invisibility-spec
- (beg (max (point-min) (1- (point-at-bol))))
- (end (point-at-eol)))
+ (beg (max (point-min) (1- (line-beginning-position))))
+ (end (line-end-position)))
(let ((inhibit-read-only t))
(add-text-properties
beg end `(invisible org-filtered org-filter-type ,type)))))
(interactive "p")
(let ((col (current-column)))
(dotimes (_ n)
- (when (next-single-property-change (point-at-eol) 'org-marker)
+ (when (next-single-property-change (line-end-position) 'org-marker)
(move-end-of-line 1)
(goto-char (next-single-property-change (point) 'org-marker))))
(org-move-to-column col))
(when (re-search-forward org-complex-heading-regexp nil t)
(goto-char (match-beginning 4)))))
(run-hooks 'org-agenda-after-show-hook)
- (and highlight (org-highlight (point-at-bol) (point-at-eol)))))
+ (and highlight (org-highlight (line-beginning-position)
+ (line-end-position)))))
(defvar org-agenda-after-show-hook nil
"Normal hook run after an item has been shown from the agenda.
(level (and (eq org-agenda-loop-over-headlines-in-active-region 'start-level)
(org-get-at-bol 'level))))
(while (< (point) mend)
- (let ((ov (make-overlay (point) (point-at-eol))))
+ (let ((ov (make-overlay (point) (line-end-position))))
(if (not (or all
(and match (looking-at-p match))
(eq level (org-get-at-bol 'level))))
(if (and (derived-mode-p 'org-mode) (not (member type '("sexp"))))
(setq dbeg (progn (org-back-to-heading t) (point))
dend (org-end-of-subtree t t))
- (setq dbeg (point-at-bol)
- dend (min (point-max) (1+ (point-at-eol)))))
+ (setq dbeg (line-beginning-position)
+ dend (min (point-max) (1+ (line-end-position)))))
(goto-char dbeg)
(while (re-search-forward "^[ \t]*\\S-" dend t) (setq n (1+ n)))))
(when (or (eq t org-agenda-confirm-kill)
(>= p beg)
(< p end))
(let ((inhibit-read-only t))
- (delete-region (point-at-bol) (1+ (point-at-eol)))))
+ (delete-region (line-beginning-position)
+ (1+ (line-end-position)))))
(beginning-of-line 0))))))
(defun org-agenda-refile (&optional goto rfloc no-update)
(let* ((marker (or (org-get-at-bol 'org-hd-marker)
(org-get-at-bol 'org-marker)))
(buffer (and marker (marker-buffer marker)))
- (prefix (buffer-substring (point-at-bol) (point-at-eol)))
+ (prefix (buffer-substring (line-beginning-position)
+ (line-end-position)))
(lkall (and buffer (org-offer-links-in-entry
buffer marker arg prefix)))
(lk0 (car lkall))
(let ((win (selected-window)))
(org-agenda-goto t)
(org-back-to-heading)
- (set-window-start (selected-window) (point-at-bol))
+ (set-window-start (selected-window) (line-beginning-position))
(cond
((= more 0)
(org-flag-subtree t)
(with-current-buffer (marker-buffer hdmarker)
(org-with-wide-buffer
(org-agenda-format-item extra newhead level cat tags dotime))))
- ;; pl (text-property-any (point-at-bol) (point-at-eol) 'org-heading t)
+ ;; pl (text-property-any (line-beginning-position)
+ ;; (line-end-position) 'org-heading t)
undone-face (org-get-at-bol 'undone-face)
done-face (org-get-at-bol 'done-face))
(beginning-of-line 1)
(replace-match new t t)
(beginning-of-line)
(when mark (move-overlay mark (point) (+ 2 (point)))))
- (add-text-properties (point-at-bol) (point-at-eol) props)
+ (add-text-properties (line-beginning-position)
+ (line-end-position) props)
(when fixface
(add-text-properties
- (point-at-bol) (point-at-eol)
+ (line-beginning-position) (line-end-position)
(list 'face
(if org-last-todo-state-is-todo
undone-face done-face))))
(beginning-of-line 1))
(t (error "Line update did not work")))
(save-restriction
- (narrow-to-region (point-at-bol) (point-at-eol))
+ (narrow-to-region (line-beginning-position) (line-end-position))
(org-agenda-finalize)))
(beginning-of-line 0)))))
(setq arg (- today cdate))))
(org-timestamp-change arg (or what 'day))
(when (and (org-at-date-range-p)
- (re-search-backward org-tr-regexp-both (point-at-bol)))
+ (re-search-backward org-tr-regexp-both
+ (line-beginning-position)))
(let ((end org-last-changed-timestamp))
(org-timestamp-change arg (or what 'day))
(setq org-last-changed-timestamp
(length stamp))
t)
(add-text-properties
- (1- (point)) (point-at-eol)
+ (1- (point)) (line-end-position)
(list 'display (org-add-props stamp nil
'face '(secondary-selection default))))
(beginning-of-line 1))
(if (equal (buffer-name) "*Calendar*")
(setq d1 (calendar-cursor-to-date t)
d2 (car calendar-mark-ring))
- (setq dp1 (get-text-property (point-at-bol) 'day))
+ (setq dp1 (get-text-property (line-beginning-position) 'day))
(unless dp1 (user-error "No date defined in current line"))
(setq d1 (calendar-gregorian-from-absolute dp1)
d2 (and (ignore-errors (mark))
(save-excursion
(goto-char (mark))
- (setq dp2 (get-text-property (point-at-bol) 'day)))
+ (setq dp2 (get-text-property (line-beginning-position) 'day)))
(calendar-gregorian-from-absolute dp2))))
(message "Diary entry: [d]ay [a]nniversary [b]lock [j]ump to date tree")
(setq char (read-char-exclusive))
(defun org-agenda-bulk-marked-p ()
"Non-nil when current entry is marked for bulk action."
- (eq (get-char-property (point-at-bol) 'type)
+ (eq (get-char-property (line-beginning-position) 'type)
'org-marked-entry-overlay))
(defun org-agenda-bulk-mark (&optional arg)
(unless (org-agenda-bulk-marked-p)
(unless m (user-error "Nothing to mark at point"))
(push m org-agenda-bulk-marked-entries)
- (setq ov (make-overlay (point-at-bol) (+ 2 (point-at-bol))))
+ (setq ov (make-overlay (line-beginning-position)
+ (+ 2 (line-beginning-position))))
(org-overlay-display ov (concat org-agenda-bulk-mark-char " ")
(org-get-todo-face "TODO")
'evaporate)
(org-agenda-bulk-unmark-all)
(cond ((org-agenda-bulk-marked-p)
(org-agenda-bulk-remove-overlays
- (point-at-bol) (+ 2 (point-at-bol)))
+ (line-beginning-position) (+ 2 (line-beginning-position)))
(setq org-agenda-bulk-marked-entries
(delete (org-get-at-bol 'org-hd-marker)
org-agenda-bulk-marked-entries))
(message "Entry unflagged")))
(defun org-agenda-get-any-marker (&optional pos)
- (or (get-text-property (or pos (point-at-bol)) 'org-hd-marker)
- (get-text-property (or pos (point-at-bol)) 'org-marker)))
+ (or (get-text-property (or pos (line-beginning-position)) 'org-hd-marker)
+ (get-text-property (or pos (line-beginning-position)) 'org-marker)))
;;; Appointment reminders
(if (org-at-table-p)
(save-excursion
(org-table-goto-line (nth 1 where))
- (point-at-bol))
+ (line-beginning-position))
(point))))))
(with-current-buffer (buffer-base-buffer (current-buffer))
(org-with-point-at pos
;; Clock in at which position?
(setq target-pos
(if (and (eobp) (not (org-at-heading-p)))
- (point-at-bol 0)
+ (line-beginning-position 0)
(point)))
(save-excursion
(when (and selected-task (marker-buffer selected-task))
(setq ts (match-string 2))
(if fail-quietly (throw 'exit nil) (error "Clock start time is gone")))
(goto-char (match-end 0))
- (delete-region (point) (point-at-eol))
+ (delete-region (point) (line-end-position))
(insert "--")
(setq te (org-insert-time-stamp (or at-time now) 'with-hm 'inactive))
(setq s (org-time-convert-to-integer
(goto-char org-clock-marker)
(if (looking-back (concat "^[ \t]*" org-clock-string ".*")
(line-beginning-position))
- (progn (delete-region (1- (point-at-bol)) (point-at-eol))
+ (progn (delete-region (1- (line-beginning-position)) (line-end-position))
(org-remove-empty-drawer-at (point)))
(message "Clock gone, cancel the timer anyway")
(sit-for 2)))
(aset ltimes l (+ (aref ltimes l) t1))))
(setq time (aref ltimes level))
(goto-char (match-beginning 0))
- (put-text-property (point) (point-at-eol)
+ (put-text-property (point) (line-end-position)
(or propname :org-clock-minutes) time)
(when headline-filter
(save-excursion
(forward-line 2)
(buffer-substring (point) (progn
(re-search-forward "^[ \t]*#\\+END" nil t)
- (point-at-bol)))))
+ (line-beginning-position)))))
;;;###autoload
(defun org-clock-report (&optional arg)
(setq n (prefix-numeric-value n))
(and (memq dir '(left down)) (setq n (- n)))
(save-excursion
- (goto-char (point-at-bol))
+ (goto-char (line-beginning-position))
(if (not (looking-at "^[ \t]*#\\+BEGIN:[ \t]+clocktable\\>.*?:block[ \t]+\\(\\S-+\\)"))
(user-error "Line needs a :block definition before this command works")
(let* ((b (match-beginning 1)) (e (match-end 1))
((not (match-end 2))
(when (and (equal (marker-buffer org-clock-marker) (current-buffer))
(> org-clock-marker (point))
- (<= org-clock-marker (point-at-eol)))
+ (<= org-clock-marker (line-end-position)))
;; The clock is running here
(setq org-clock-start-time
(org-time-string-to-time (match-string 1)))
(require 'org-agenda)
(let (p m tp np dir txt)
(cond
- ((setq p (text-property-any (point-at-bol) (point-at-eol)
+ ((setq p (text-property-any (line-beginning-position) (line-end-position)
'org-imenu t))
(setq m (get-text-property p 'org-imenu-marker))
(with-current-buffer (marker-buffer m)
(overlays-at (point))))
(org-agenda-remove-restriction-lock 'noupdate)
(org-agenda-set-restriction-lock 'subtree))))
- ((setq p (text-property-any (point-at-bol) (point-at-eol)
+ ((setq p (text-property-any (line-beginning-position) (line-end-position)
'speedbar-function 'speedbar-find-file))
(setq tp (previous-single-property-change
(1+ p) 'speedbar-function)
(org-agenda-set-restriction-lock 'file)))
(t (user-error "Don't know how to restrict Org mode agenda")))
(move-overlay org-speedbar-restriction-lock-overlay
- (point-at-bol) (point-at-eol))
+ (line-beginning-position) (line-end-position))
(setq current-prefix-arg nil)
(org-agenda-maybe-redo)))
(key (progn (looking-at "[ \t]*#\\+\\(\\S-*\\):")
(upcase (match-string-no-properties 1))))
(value (org-trim (buffer-substring-no-properties
- (match-end 0) (point-at-eol))))
+ (match-end 0) (line-end-position))))
(pos-before-blank (progn (forward-line) (point)))
(end (progn (skip-chars-forward " \r\t\n" limit)
(if (eobp) (point) (line-beginning-position)))))
(goto-char (point-min))
(org-skip-whitespace)
(org-element--parse-elements
- (point-at-bol) (point-max)
+ (line-beginning-position) (point-max)
;; Start in `first-section' mode so text before the first
;; headline belongs to a section.
'first-section nil granularity visible-only (list 'org-data nil))))
(end-A (save-excursion
(goto-char (org-element-property :end elem-A))
(skip-chars-backward " \r\t\n")
- (point-at-eol)))
+ (line-end-position)))
(beg-B (org-element-property :begin elem-B))
(end-B (save-excursion
(goto-char (org-element-property :end elem-B))
(skip-chars-backward " \r\t\n")
- (point-at-eol)))
+ (line-end-position)))
;; Store inner overlays responsible for visibility status.
;; We also need to store their boundaries as they will be
;; removed from buffer.
(moment (org-time-subtract nil
(* 3600 org-extend-today-until))))
(save-excursion
- (goto-char (if line (point-at-bol) (point-min)))
+ (goto-char (if line (line-beginning-position) (point-min)))
(while (not (eobp))
(let ((habit (get-text-property (point) 'org-habit-p))
(invisible-prop (get-text-property (point) 'invisible)))
(setq beg (point))
(replace-match down-task nil t nil 1)
(org-inlinetask-goto-end)
- (if (and (eobp) (looking-back "END\\s-*" (point-at-bol)))
+ (if (and (eobp) (looking-back "END\\s-*" (line-beginning-position)))
(beginning-of-line)
(forward-line -1))
(unless (= (point) beg)
(setq beg (point))
(replace-match down-task nil t nil 1)
(org-inlinetask-goto-end)
- (if (and (eobp) (looking-back "END\\s-*" (point-at-bol)))
+ (if (and (eobp) (looking-back "END\\s-*" (line-beginning-position)))
(beginning-of-line)
(forward-line -1))
(unless (= (point) beg)
(if (bolp) (1- (point)) (point))))
(start (save-excursion
(org-inlinetask-goto-beginning)
- (point-at-eol))))
+ (line-end-position))))
(cond
;; Nothing to show/hide.
((= end start))
(and (not (looking-at beg-re))
(not (looking-at end-re))
(setq beg (and (re-search-backward beg-re lim-up t)
- (1+ (point-at-eol))))
+ (1+ (line-end-position))))
(setq end (or (and (re-search-forward end-re lim-down t)
(1- (match-beginning 0)))
lim-down))
(when (save-excursion
(and (not (looking-at block-re))
(setq beg (and (re-search-backward block-re lim-up t)
- (1+ (point-at-eol))))
+ (1+ (line-end-position))))
(looking-at "^[ \t]*#\\+begin_\\(\\S-+\\)")
(setq type (downcase (match-string 1)))
(goto-char beg)
(setq end (or (and (re-search-forward block-re lim-down t)
- (1- (point-at-bol)))
+ (1- (line-beginning-position)))
lim-down))
(>= end pos)
(equal (downcase (match-string 1)) "end")))
(end-re (concat beg-re "END[ \t]*$")))
(and (not (looking-at "^\\*+"))
(setq beg (and (re-search-backward beg-re lim-up t)
- (1+ (point-at-eol))))
+ (1+ (line-end-position))))
(not (looking-at end-re))
(setq end (and (re-search-forward end-re lim-down t)
(1- (match-beginning 0))))
6. position at item end.
Thus the following list, where numbers in parens are
-point-at-bol:
+line-beginning-position:
- [X] first item (1)
1. sub-item 1 (18)
;; Ensure list ends at the first blank line.
(lambda ()
(skip-chars-backward " \r\t\n")
- (min (1+ (point-at-eol)) lim-down))))
+ (min (1+ (line-end-position)) lim-down))))
;; 1. Read list from starting item to its beginning, and save
;; top item position and indentation in BEG-CELL. Also store
;; ending position of items in END-LST.
(save-excursion
(goto-char (org-list-get-item-end item struct))
(skip-chars-backward " \r\t\n")
- (point-at-eol)))
+ (line-end-position)))
(defun org-list-get-parent (item struct parents)
"Return parent of ITEM or nil.
(lambda ()
;; Count blank lines above beginning of line.
(save-excursion
- (count-lines (goto-char (point-at-bol))
+ (count-lines (goto-char (line-beginning-position))
(progn (skip-chars-backward " \r\t\n")
(forward-line)
(point)))))))
;; must be removed, or they will be left, stacking up
;; after the list.
(when (< item-end pos)
- (delete-region (1- item-end) (point-at-eol)))
+ (delete-region (1- item-end) (line-end-position)))
(skip-chars-backward " \r\t\n")
;; Cut position is after any blank on the line.
(save-excursion
(save-excursion
(goto-char item)
(skip-chars-backward " \r\t\n")
- (min (1+ (point-at-eol)) (point-max)))
+ (min (1+ (line-end-position)) (point-max)))
item)))
;; Remove item from buffer.
(delete-region beg end)
(setq dest (org-list-get-list-end item struct prevs))
(save-excursion
(goto-char (org-list-get-last-item item struct prevs))
- (point-at-eol)))
+ (line-end-position)))
((and (stringp dest) (string-match-p "\\`[0-9]+\\'" dest))
(let* ((all (org-list-get-all-items item struct prevs))
(len (length all))
(save-excursion
(goto-char
(org-list-get-last-item item struct prevs))
- (point-at-eol)))))
+ (line-end-position)))))
(t dest)))
(org-M-RET-may-split-line nil)
;; Store inner overlays (to preserve visibility).
(insert (concat new-box (unless counterp " "))))))
;; c. Indent item to appropriate column.
(unless (= new-ind old-ind)
- (delete-region (goto-char (point-at-bol))
+ (delete-region (goto-char (line-beginning-position))
(progn (skip-chars-forward " \t") (point)))
(indent-to new-ind))))))
;; 1. First get list of items and position endings. We maintain
beginning of the item."
(let* ((struct (org-list-struct))
(prevs (org-list-prevs-alist struct))
- (item (copy-marker (point-at-bol)))
+ (item (copy-marker (line-beginning-position)))
(all (org-list-get-all-items (marker-position item) struct prevs))
(value init-value))
(dolist (e (nreverse all))
(interactive)
(unless (org-at-item-p) (error "Not at an item"))
(let* ((col (current-column))
- (item (point-at-bol))
+ (item (line-beginning-position))
(struct (org-list-struct))
(prevs (org-list-prevs-alist struct))
- (next-item (org-list-get-next-item (point-at-bol) struct prevs)))
+ (next-item (org-list-get-next-item (line-beginning-position) struct prevs)))
(unless (or next-item org-list-use-circular-motion)
(user-error "Cannot move this item further down"))
(if (not next-item)
(interactive)
(unless (org-at-item-p) (error "Not at an item"))
(let* ((col (current-column))
- (item (point-at-bol))
+ (item (line-beginning-position))
(struct (org-list-struct))
(prevs (org-list-prevs-alist struct))
- (prev-item (org-list-get-prev-item (point-at-bol) struct prevs)))
+ (prev-item (org-list-get-prev-item (line-beginning-position) struct prevs)))
(unless (or prev-item org-list-use-circular-motion)
(user-error "Cannot move this item further up"))
(if (not prev-item)
(old-struct (copy-tree struct))
(cbox (org-list-get-checkbox cpos struct))
(prevs (org-list-prevs-alist struct))
- (start (org-list-get-list-begin (point-at-bol) struct prevs))
+ (start (org-list-get-list-begin (line-beginning-position) struct prevs))
(new (unless (and cbox (equal arg '(4)) (equal start cpos))
"[ ]")))
(dolist (pos (org-list-get-all-items
(let ((limit (region-end)))
(goto-char (region-beginning))
(if (org-list-search-forward (org-item-beginning-re) limit t)
- (setq lim-up (point-at-bol))
+ (setq lim-up (line-beginning-position))
(error "No item in region"))
(setq lim-down (copy-marker limit))))
((org-at-heading-p)
(let ((limit (save-excursion (outline-next-heading) (point))))
(org-end-of-meta-data t)
(if (org-list-search-forward (org-item-beginning-re) limit t)
- (setq lim-up (point-at-bol))
+ (setq lim-up (line-beginning-position))
(error "No item in subtree"))
(setq lim-down (copy-marker limit))))
;; Just one item: set SINGLEP flag.
((org-at-item-p)
(setq singlep t)
- (setq lim-up (point-at-bol)
- lim-down (copy-marker (point-at-eol))))
+ (setq lim-up (line-beginning-position)
+ lim-down (copy-marker (line-end-position))))
(t (error "Not at an item or heading, and no active region"))))
;; Determine the checkbox going to be applied to all items
;; within bounds.
;; Are we going to move the whole list?
(specialp
(and (not regionp)
- (= top (point-at-bol))
+ (= top (line-beginning-position))
(cdr (assq 'indent org-list-automatic-rules))
(if no-subtree
(user-error
(progn
(set-marker org-last-indent-begin-marker rbeg)
(set-marker org-last-indent-end-marker rend))
- (set-marker org-last-indent-begin-marker (point-at-bol))
+ (set-marker org-last-indent-begin-marker (line-beginning-position))
(set-marker org-last-indent-end-marker
(cond
(specialp (org-list-get-bottom-point struct))
- (no-subtree (1+ (point-at-bol)))
- (t (org-list-get-item-end (point-at-bol) struct))))))
+ (no-subtree (1+ (line-beginning-position)))
+ (t (org-list-get-item-end (line-beginning-position) struct))))))
(let* ((beg (marker-position org-last-indent-begin-marker))
(end (marker-position org-last-indent-end-marker)))
(cond
(let* ((case-func (if with-case 'identity 'downcase))
(struct (org-list-struct))
(prevs (org-list-prevs-alist struct))
- (start (org-list-get-list-begin (point-at-bol) struct prevs))
- (end (org-list-get-list-end (point-at-bol) struct prevs))
+ (start (org-list-get-list-begin (line-beginning-position) struct prevs))
+ (end (org-list-get-list-end (line-beginning-position) struct prevs))
(sorting-type
(or sorting-type
(progn
((= dcst ?n)
(string-to-number
(org-sort-remove-invisible
- (buffer-substring (match-end 0) (point-at-eol)))))
+ (buffer-substring (match-end 0) (line-end-position)))))
((= dcst ?a)
(funcall case-func
(org-sort-remove-invisible
(buffer-substring
- (match-end 0) (point-at-eol)))))
+ (match-end 0) (line-end-position)))))
((= dcst ?t)
(cond
;; If it is a timer list, convert timer to seconds
((org-at-item-timer-p)
(org-timer-hms-to-secs (match-string 1)))
((or (save-excursion
- (re-search-forward org-ts-regexp (point-at-eol) t))
+ (re-search-forward org-ts-regexp (line-end-position) t))
(save-excursion (re-search-forward org-ts-regexp-both
- (point-at-eol) t)))
+ (line-end-position) t)))
(org-time-string-to-seconds (match-string 0)))
(t (float-time now))))
((= dcst ?x) (or (and (stringp (match-string 1))
(save-excursion
(goto-char pos)
(skip-chars-forward " \r\t\n")
- (point-at-bol))))
+ (line-beginning-position))))
beg end)
;; Determine boundaries of changes.
(if (org-region-active-p)
(setq beg (funcall skip-blanks (region-beginning))
end (copy-marker (region-end)))
- (setq beg (point-at-bol)
- end (copy-marker (point-at-eol))))
+ (setq beg (line-beginning-position)
+ end (copy-marker (line-end-position))))
;; Depending on the starting line, choose an action on the text
;; between BEG and END.
(org-with-limited-levels
(defsubst org-get-at-bol (property)
"Get text property PROPERTY at the beginning of line."
- (get-text-property (point-at-bol) property))
+ (get-text-property (line-beginning-position) property))
(defun org-get-at-eol (property n)
"Get text property PROPERTY at the end of line less N characters."
- (get-text-property (- (point-at-eol) n) property))
+ (get-text-property (- (line-end-position) n) property))
(defun org-find-text-property-in-string (prop s)
"Return the first non-nil value of property PROP in string S."
((looking-at "[ \t]*$")) ; keep empty lines
((looking-at "=+$")
;; remove underlining
- (delete-region (point) (point-at-eol)))
+ (delete-region (point) (line-end-position)))
((get-text-property (point) 'org-agenda-structural-header)
(setq in-date nil)
(setq app (get-text-property (point) 'org-agenda-title-append))
(get-text-property (point) 'org-marker)))
(setq sexp (member (get-text-property (point) 'type)
'("diary" "sexp")))
- (if (setq pl (text-property-any (point) (point-at-eol) 'org-heading t))
+ (if (setq pl (text-property-any (point) (line-end-position) 'org-heading t))
(progn
(setq prefix (org-trim (buffer-substring
(point) pl))
line (org-trim (buffer-substring
pl
- (point-at-eol))))
- (delete-region (point-at-bol) (point-at-eol))
+ (line-end-position))))
+ (delete-region (line-beginning-position) (line-end-position))
(insert line "<before>" prefix "</before>")
(beginning-of-line 1))
(and (looking-at "[ \t]+") (replace-match "")))
(org-mobile-timestamp-buffer (marker-buffer id-pos))
(push (marker-buffer id-pos) buf-list))
(unless (markerp id-pos)
- (goto-char (+ 2 (point-at-bol)))
+ (goto-char (+ 2 (line-beginning-position)))
(if (stringp id-pos)
(insert id-pos " ")
(insert "BAD REFERENCE "))
(org-archive-to-archive-sibling))
((eq what 'body)
- (setq current (buffer-substring (min (1+ (point-at-eol)) (point-max))
+ (setq current (buffer-substring (min (1+ (line-end-position)) (point-max))
(save-excursion (outline-next-heading)
(point))))
(if (not (string-match "\\S-" current)) (setq current nil))
(defun org-mouse-re-search-line (regexp)
"Search the current line for a given regular expression."
(beginning-of-line)
- (re-search-forward regexp (point-at-eol) t))
+ (re-search-forward regexp (line-end-position) t))
(defun org-mouse-end-headline ()
"Go to the end of current headline (ignoring tags)."
(insert "+ "))
(:end ; insert text here
(skip-chars-backward " \t")
- (kill-region (point) (point-at-eol))
+ (kill-region (point) (line-end-position))
(unless (looking-back org-mouse-punctuation (line-beginning-position))
(insert (concat org-mouse-punctuation " ")))))
(insert text)
(defun org-mouse-do-remotely (command)
;; (org-agenda-check-no-diary)
(when (get-text-property (point) 'org-marker)
- (let* ((anticol (- (point-at-eol) (point)))
+ (let* ((anticol (- (line-end-position) (point)))
(marker (get-text-property (point) 'org-marker))
(buffer (marker-buffer marker))
(pos (marker-position marker))
(org-flag-heading nil))) ; show the next heading
(org-back-to-heading)
(setq marker (point-marker))
- (goto-char (max (point-at-bol) (- (point-at-eol) anticol)))
+ (goto-char (max (line-beginning-position) (- (line-end-position) anticol)))
(funcall command)
(message "_cmd: %S" org-mouse-cmd)
(message "this-command: %S" this-command)
(unless (or (org-kill-is-subtree-p
(buffer-substring region-start region-end))
(prog1 org-refile-active-region-within-subtree
- (let ((s (point-at-eol)))
+ (let ((s (line-end-position)))
(org-toggle-heading)
- (setq region-end (+ (- (point-at-eol) s) region-end)))))
+ (setq region-end (+ (- (line-end-position) s) region-end)))))
(user-error "The region is not a (sequence of) subtree(s)")))
(if (equal arg '(16))
(org-refile-goto-last-stored)
(looking-at-p ".*|\\s-+<[rcl]?\\([0-9]+\\)?>"))
(move-beginning-of-line 2))
(line-beginning-position)))
- (end (save-excursion (goto-char beg) (point-at-eol))))
+ (end (save-excursion (goto-char beg) (line-end-position))))
(if (pos-visible-in-window-p beg)
(when (overlayp org-table-header-overlay)
(delete-overlay org-table-header-overlay))
(line (concat (apply 'concat indent "|" (make-list columns " |"))
"\n")))
(if (string-match "^[ \t]*$" (buffer-substring-no-properties
- (point-at-bol) (point)))
+ (line-beginning-position) (point)))
(beginning-of-line 1)
(newline))
;; (mapcar (lambda (x) (insert line)) (make-list rows t))
(while (> n 1)
(setq n (1- n))
(org-table-previous-field))
- (if (not (re-search-backward "|" (point-at-bol 0) t))
+ (if (not (re-search-backward "|" (line-beginning-position 0) t))
(user-error "No more table fields before the current")
(goto-char (match-end 0))
(and (looking-at " ") (forward-char 1)))
(while (> n 1)
(setq n (1- n))
(org-table-next-field))
- (when (re-search-forward "|" (point-at-eol 1) t)
+ (when (re-search-forward "|" (line-end-position 1) t)
(backward-char 1)
(skip-chars-backward " ")
(when (and (equal (char-before (point)) ?|) (equal (char-after (point)) ?\s))
(goto-char (org-table-begin))
(while (and (re-search-forward org-table-dataline-regexp end t)
(setq cnt (1+ cnt))
- (< (point-at-eol) pos))))
+ (< (line-end-position) pos))))
cnt))
(defun org-table-current-column ()
(beginning-of-line 1)
(when (> n 0)
(while (and (> (setq n (1- n)) -1)
- (or (search-forward "|" (point-at-eol) t)
+ (or (search-forward "|" (line-end-position) t)
(and force
(progn (end-of-line 1)
(skip-chars-backward "^|")
(org-table-align))
(org-table-with-shrunk-columns
(let ((line (org-table-clean-line
- (buffer-substring (point-at-bol) (point-at-eol))))
+ (buffer-substring (line-beginning-position) (line-end-position))))
(col (current-column)))
(while (string-match "|\\( +\\)|" line)
(setq line (replace-match
(dline (and (not (org-match-line org-table-hline-regexp))
(org-table-current-dline))))
(org-table-with-shrunk-columns
- (kill-region (point-at-bol) (min (1+ (point-at-eol)) (point-max)))
+ (kill-region (line-beginning-position)
+ (min (1+ (line-end-position)) (point-max)))
(if (not (org-at-table-p)) (beginning-of-line 0))
(org-move-to-column col)
(when (and dline
(format "@%d\\$[0-9]+=.*?\\(::\\|$\\)" remove))))
s n a)
(when remove
- (while (re-search-forward re2 (point-at-eol) t)
+ (while (re-search-forward re2 (line-end-position) t)
(unless (save-match-data (org-in-regexp "remote([^)]+?)"))
(if (equal (char-before (match-beginning 0)) ?.)
(user-error
"Change makes TBLFM term %s invalid, use undo to recover"
(match-string 0))
(replace-match "")))))
- (while (re-search-forward re (point-at-eol) t)
+ (while (re-search-forward re (line-end-position) t)
(unless (save-match-data (org-in-regexp "remote([^)]+?)"))
(setq s (match-string 1) n (string-to-number s))
(cond
(let ((id 0) (ih 0) hline eol str ov)
(goto-char (org-table-begin))
(while (org-at-table-p)
- (setq eol (point-at-eol))
- (setq ov (make-overlay (point-at-bol) (1+ (point-at-bol))))
+ (setq eol (line-end-position))
+ (setq ov (make-overlay (line-beginning-position)
+ (1+ (line-beginning-position))))
(push ov org-table-coordinate-overlays)
(setq hline (looking-at org-table-hline-regexp))
(setq str (if hline (format "I*%-2d" (setq ih (1+ ih)))
((not local) nil)
(t (user-error "No reference at point")))
match (and what (or match (match-string 0))))
- (when (and match (not (equal (match-beginning 0) (point-at-bol))))
+ (when (and match (not (equal (match-beginning 0) (line-beginning-position))))
(org-table-add-rectangle-overlay (match-beginning 0) (match-end 0)
'secondary-selection))
(add-hook 'before-change-functions
(emph-p (get-text-property mpos 'org-emphasis))
(link-p (get-text-property mpos 'mouse-face))
(keyw-p (eq 'org-special-keyword (get-text-property mpos 'face))))
- (goto-char (point-at-bol))
+ (goto-char (line-beginning-position))
(setq table-p (looking-at-p org-table-dataline-regexp)
comment-p (looking-at-p "^[ \t]*#[ +]"))
(goto-char pos)
(and (memq org-cycle-emulate-tab '(white whitestart))
(save-excursion (beginning-of-line 1) (looking-at "[ \t]*"))
(or (and (eq org-cycle-emulate-tab 'white)
- (= (match-end 0) (point-at-eol)))
+ (= (match-end 0) (line-end-position)))
(and (eq org-cycle-emulate-tab 'whitestart)
(>= (match-end 0) pos)))))
(call-interactively (global-key-binding (kbd "TAB"))))
(progn
(beginning-of-line)
(setq struct (org-list-struct))
- (setq eoh (point-at-eol))
+ (setq eoh (line-end-position))
(setq eos (org-list-get-item-end-before-blank (point) struct))
(setq has-children (org-list-has-child-p (point) struct)))
(org-back-to-heading)
(unless (org-before-first-heading-p)
(run-hook-with-args 'org-pre-cycle-hook 'children))
(if (org-at-item-p)
- (org-list-set-item-visibility (point-at-bol) struct 'children)
+ (org-list-set-item-visibility (line-beginning-position) struct 'children)
(org-show-entry)
(org-with-limited-levels (org-show-children))
(org-show-set-visibility 'tree)
(org-get-next-sibling)
(org-get-next-sibling))
(if (org-at-heading-p)
- (point-at-eol)
+ (line-end-position)
(point))))
(level (looking-at "\\*+"))
(re (when level (concat "^" (regexp-quote (match-string 0)) " "))))
"Get the entry text, after heading, entire subtree."
(save-excursion
(org-back-to-heading t)
- (buffer-substring (point-at-bol 2) (org-end-of-subtree t))))
+ (buffer-substring (line-beginning-position 2) (org-end-of-subtree t))))
(defun org-edit-headline (&optional heading)
"Edit the current headline.
(org-time-string-to-seconds (match-string 1))
(float-time now))))
((= dcst ?p)
- (if (re-search-forward org-priority-regexp (point-at-eol) t)
+ (if (re-search-forward org-priority-regexp (line-end-position) t)
(string-to-char (match-string 2))
org-priority-default))
((= dcst ?r)
(defun org-create-dblock (plist)
"Create a dynamic block section, with parameters taken from PLIST.
PLIST must contain a :name entry which is used as the name of the block."
- (when (string-match "\\S-" (buffer-substring (point-at-bol) (point-at-eol)))
+ (when (string-match "\\S-" (buffer-substring (line-beginning-position)
+ (line-end-position)))
(end-of-line 1)
(newline))
(let ((col (current-column))
(run-hooks 'org-after-todo-state-change-hook)
(when (and arg (not (member org-state org-done-keywords)))
(setq head (org-get-todo-sequence-head org-state)))
- (put-text-property (point-at-bol) (point-at-eol) 'org-todo-head head)
+ (put-text-property (line-beginning-position)
+ (line-end-position) 'org-todo-head head)
;; Do we need to trigger a repeat?
(when now-done-p
(when (boundp 'org-agenda-headline-snapshot-before-repeat)
(beginning-of-line 1)
(while (re-search-forward
"\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)"
- (point-at-eol) t)
+ (line-end-position) t)
(replace-match (if (match-end 2) "[100%]" "[0/0]") t t)))))
(goto-char pos)
(move-marker pos nil)))))
(downcase (or (org-entry-get nil "COOKIE_DATA")
"")))))
(throw 'exit nil))
- (while (re-search-forward box-re (point-at-eol) t)
+ (while (re-search-forward box-re (line-end-position) t)
(setq cnt-all 0 cnt-done 0 cookie-present t)
(setq is-percent (match-end 2) checkbox-beg (match-beginning 0))
(save-match-data
(let (p)
(cond
((not kwd)
- (or (get-text-property (point-at-bol) 'org-todo-head)
+ (or (get-text-property (line-beginning-position) 'org-todo-head)
(progn
- (setq p (next-single-property-change (point-at-bol) 'org-todo-head
- nil (point-at-eol)))
+ (setq p (next-single-property-change (line-beginning-position)
+ 'org-todo-head
+ nil (line-end-position)))
(get-text-property p 'org-todo-head))))
((not (member kwd org-todo-keywords-1))
(car org-todo-keywords-1))
(outline-next-heading)
(while (re-search-backward re beg t)
(replace-match "")
- (if (and (string-match "\\S-" (buffer-substring (point-at-bol) (point)))
+ (if (and (string-match "\\S-" (buffer-substring (line-beginning-position) (point)))
(equal (char-before) ?\ ))
(backward-delete-char 1)
(when (string-match "^[ \t]*$" (buffer-substring
- (point-at-bol) (point-at-eol)))
- (delete-region (point-at-bol)
- (min (point-max) (1+ (point-at-eol))))))))))
+ (line-beginning-position) (line-end-position)))
+ (delete-region (line-beginning-position)
+ (min (point-max) (1+ (line-end-position))))))))))
(defvar org-time-was-given) ; dynamically scoped parameter
(defvar org-end-time-was-given) ; dynamically scoped parameter
(defun org-fast-tag-show-exit (flag)
(save-excursion
(org-goto-line 3)
- (when (re-search-forward "[ \t]+Next change exits" (point-at-eol) t)
+ (when (re-search-forward "[ \t]+Next change exits" (line-end-position) t)
(replace-match ""))
(when flag
(end-of-line 1)
(setq ov-start (match-beginning 1)
ov-end (match-end 1)
ov-prefix "")
- (setq ov-start (1- (point-at-eol))
+ (setq ov-start (1- (line-end-position))
ov-end (1+ ov-start))
(skip-chars-forward "^\n\r")
(setq ov-prefix
(when (eq exit-after-next 'now) (throw 'exit t))
(goto-char (point-min))
(beginning-of-line 2)
- (delete-region (point) (point-at-eol))
+ (delete-region (point) (line-end-position))
(org-fast-tag-insert "Current" current c-face)
(org-set-current-tags-overlay current ov-prefix)
(let ((tag-re (concat "\\[.\\] \\(" org-tag-re "\\)")))
(max (point-min) (- (point) 4)) (point))
" "))
(insert " ")))
- (let* ((ans (concat (buffer-substring (point-at-bol) (point-max))
+ (let* ((ans (concat (buffer-substring (line-beginning-position)
+ (point-max))
" " (or org-ans1 org-ans2)))
(org-end-time-was-given nil)
(f (org-read-date-analyze ans org-def org-defdecode))
(when org-read-date-analyze-futurep
(setq txt (concat txt " (=>F)")))
(setq org-read-date-overlay
- (make-overlay (1- (point-at-eol)) (point-at-eol)))
+ (make-overlay (1- (line-end-position)) (line-end-position)))
(org-overlay-display org-read-date-overlay txt 'secondary-selection)))))
(defun org-read-date-analyze (ans def defdecode)
(org-clock-update-time-maybe)
(save-excursion
(unless (org-at-date-range-p t)
- (goto-char (point-at-bol))
- (re-search-forward org-tr-regexp-both (point-at-eol) t))
+ (goto-char (line-beginning-position))
+ (re-search-forward org-tr-regexp-both (line-end-position) t))
(unless (org-at-date-range-p t)
(user-error "Not at a time-stamp range, and none found in current line")))
(let* ((ts1 (match-string 1))
(goto-char (point-min))
(while (re-search-forward rea nil t)
(when (org-at-heading-p t)
- (add-text-properties (point-at-bol) (org-end-of-subtree t) pa))))
+ (add-text-properties (line-beginning-position)
+ (org-end-of-subtree t) pa))))
(goto-char (point-min))
(setq re (format "^\\*+ .*\\<%s\\>" org-comment-string))
(while (re-search-forward re nil t)
(save-excursion
(catch 'exit
(unless (org-region-active-p)
- (setq beg (point-at-bol))
+ (setq beg (line-beginning-position))
(beginning-of-line 2)
(while (and (not (eobp)) ;; this is like `next-line'
(get-char-property (1- (point)) 'invisible))
(beginning-of-line 2))
(setq end (point))
(goto-char beg)
- (goto-char (point-at-eol))
+ (goto-char (line-end-position))
(setq end (max end (point)))
(while (re-search-forward re end t)
(when (get-char-property (match-beginning 0) 'invisible)
(goto-char pos)
(while (org-at-comment-p) (forward-line))
(skip-chars-forward " \r\t\n")
- (point-at-bol))))
+ (line-beginning-position))))
beg end toggled)
;; Determine boundaries of changes. If a universal prefix has
;; been given, put the list in a region. If region ends at a bol,
(setq beg (funcall skip-blanks (region-beginning))
end (copy-marker (save-excursion
(goto-char (region-end))
- (if (bolp) (point) (point-at-eol)))))
- (setq beg (funcall skip-blanks (point-at-bol))
- end (copy-marker (point-at-eol))))
+ (if (bolp) (point) (line-end-position)))))
+ (setq beg (funcall skip-blanks (line-beginning-position))
+ end (copy-marker (line-end-position))))
;; Ensure inline tasks don't count as headings.
(org-with-limited-levels
(save-excursion
;; First the large context
(cond
((org-at-heading-p t)
- (push (list :headline (point-at-bol) (point-at-eol)) clist)
+ (push (list :headline (line-beginning-position)
+ (line-end-position))
+ clist)
(when (progn
(beginning-of-line 1)
(looking-at org-todo-line-tags-regexp))
((org-at-item-p)
(push (org-point-in-group p 2 :item-bullet) clist)
- (push (list :item (point-at-bol)
+ (push (list :item (line-beginning-position)
(save-excursion (org-end-of-item) (point)))
clist)
(and (org-at-item-checkbox-p)
(beginning-of-line 1)
(skip-chars-backward "\n")
(or (org-at-heading-p)
- (looking-back ":END:.*" (point-at-bol))))))
+ (looking-back ":END:.*" (line-beginning-position))))))
(let* ((element (save-excursion (beginning-of-line) (org-element-at-point)))
(type (org-element-type element)))
(cond ((and (memq type '(plain-list item))
(point))))
(org-babel-do-in-edit-buffer (call-interactively 'comment-dwim))
(beginning-of-line)
- (if (looking-at "\\s-*$") (delete-region (point) (point-at-eol))
+ (if (looking-at "\\s-*$") (delete-region (point) (line-end-position))
(open-line 1))
(org-indent-line)
(insert "# ")))
(and (looking-at "[ \t]*$")
(string-match
"\\`\\*+\\'"
- (buffer-substring (point-at-bol) (point)))))))
+ (buffer-substring (line-beginning-position) (point)))))))
swallowp)
(cond
((and subtreep org-yank-folded-subtrees)
(beginning-of-line 1)
(push-mark beg 'nomsg)))
((and subtreep org-yank-adjusted-subtrees)
- (let ((beg (point-at-bol)))
+ (let ((beg (line-beginning-position)))
(org-paste-subtree nil nil 'for-yank)
(push-mark beg 'nomsg)))
(t
(let ((font-lock-fontify-region-function #'ignore))
;; insert-and-inherit will pick the right face automatically
(while (search-forward-regexp "^:" nil t)
- (setq bound (point-at-eol))
+ (setq bound (line-end-position))
(while (search-forward cipher-string bound 'end)
(decipher-insert plain-char)))))))
(skip-syntax-forward "w_")
(when (search-backward-regexp
cfengine-mode-syntax-functions-regex
- (point-at-bol)
+ (line-beginning-position)
t)
(match-string 1)))))
(and w (assq (intern w) flist))))))
"Return completions for function name around or before point."
(let* ((bounds (save-excursion
(let ((p (point)))
- (skip-syntax-backward "w_" (point-at-bol))
+ (skip-syntax-backward "w_" (line-beginning-position))
(list (point) p))))
(syntax (cfengine3-make-syntax-cache))
(flist (assq 'functions syntax)))
"Insert a construction appropriate after a keyword.
Help message may be switched off by setting `cperl-message-electric-keyword'
to nil."
- (let ((beg (point-at-bol))
+ (let ((beg (line-beginning-position))
(dollar (and (eq last-command-event ?$)
(eq this-command 'self-insert-command)))
(delete (and (memq last-command-event '(?\s ?\n ?\t ?\f))
"Insert a construction appropriate after a keyword.
Help message may be switched off by setting `cperl-message-electric-keyword'
to nil."
- (let ((beg (point-at-bol)))
+ (let ((beg (line-beginning-position)))
(and (save-excursion
(skip-chars-backward "[:alpha:]")
(cperl-after-expr-p nil "{;:"))
"Go to end of line, open a new line and indent appropriately.
If in POD, insert appropriate lines."
(interactive)
- (let ((beg (point-at-bol))
- (end (point-at-eol))
+ (let ((beg (line-beginning-position))
+ (end (line-end-position))
(pos (point)) start over cut res)
(if (and ; Check if we need to split:
; i.e., on a boundary and inside "{...}"
(forward-paragraph -1)
(forward-word-strictly 1)
(setq pos (point))
- (setq cut (buffer-substring (point) (point-at-eol)))
- (delete-char (- (point-at-eol) (point)))
+ (setq cut (buffer-substring (point) (line-end-position)))
+ (delete-char (- (line-end-position) (point)))
(setq res (expand-abbrev))
(save-excursion
(goto-char pos)
(point-max)))) ; do not loop if no syntaxification
;; label:
(t
- (setq colon-line-end (point-at-eol))
+ (setq colon-line-end (line-end-position))
(search-forward ":"))))
;; We are at beginning of code (NOT label or comment)
;; First, the following code counts
(looking-at (concat cperl-sub-regexp "\\>"))))
(setq p (nth 1 ; start of innermost containing list
(parse-partial-sexp
- (point-at-bol)
+ (line-beginning-position)
(point)))))
(progn
(goto-char (1+ p)) ; enclosing block on the same line
Returns true if comment is found. In POD will not move the point."
;; If the line is inside other syntax groups (qq-style strings, HERE-docs)
;; then looks for literal # or end-of-line.
- (let (state stop-in cpoint (lim (point-at-eol)) pr e)
+ (let (state stop-in cpoint (lim (line-end-position)) pr e)
(or cperl-font-locking
(cperl-update-syntaxification lim))
(beginning-of-line)
"")
tb (match-beginning 0))
(setq argument nil)
- (put-text-property (point-at-bol) b 'first-format-line 't)
+ (put-text-property (line-beginning-position)
+ b 'first-format-line 't)
(if cperl-pod-here-fontify
(while (and (eq (forward-line) 0)
(not (looking-at "^[.;]$")))
conditional/loop constructs."
(interactive)
(save-excursion
- (let ((tmp-end (point-at-eol)) top done)
+ (let ((tmp-end (line-end-position)) top done)
(save-excursion
(beginning-of-line)
(while (null done)
"\\<\\(else\\|elsif\\|continue\\)\\>"))
(progn
(goto-char (match-end 0))
- (setq tmp-end (point-at-eol)))
+ (setq tmp-end (line-end-position)))
(setq done t))))
- (setq tmp-end (point-at-eol)))
+ (setq tmp-end (line-end-position)))
(goto-char tmp-end)
(setq tmp-end (point-marker)))
(if cperl-indent-region-fix-constructs
(interactive)
(or end
(setq end (point-max)))
- (let ((ee (point-at-eol))
+ (let ((ee (line-end-position))
(cperl-indent-region-fix-constructs
(or cperl-indent-region-fix-constructs 1))
p pp ml have-brace ret)
(if (cperl-indent-line parse-data)
(setq ret (cperl-fix-line-spacing end parse-data)))))))))))
(beginning-of-line)
- (setq p (point) pp (point-at-eol)) ; May be different from ee.
+ (setq p (point) pp (line-end-position)) ; May be different from ee.
;; Now check whether there is a hanging `}'
;; Looking at:
;; } blah
;; Get to the something meaningful
(or (eobp) (eolp) (forward-char 1))
(re-search-backward "[-[:alnum:]_:!&*+,./<=>?\\^|~$%@]"
- (point-at-bol)
+ (line-beginning-position)
'to-beg)
;; (cond
;; ((or (eobp) (looking-at "[][ \t\n{}();,]")) ; Not at a symbol
;; go to the arg after `&rest'.
(if (and key-have-value
(save-excursion
- (not (re-search-forward ":.*" (point-at-eol) t)))
+ (not (re-search-forward ":.*" (line-end-position) t)))
(string-match "&rest \\([^ ()]*\\)" args))
(setq index nil ; Skip next block based on positional args.
start (match-beginning 1)
;; Naive match found. Qualify the match.
(and (funcall (car order) pattern)
;; Make sure it is not a previous qualified match.
- (not (member (set-marker match-marker (point-at-bol))
+ (not (member (set-marker match-marker (line-beginning-position))
tag-lines-already-matched))
(throw 'qualified-match-found nil))
(if next-line-after-failure-p
;; Find the end of the tag and record the whole tag text.
(search-forward "\177")
- (setq tag-text (buffer-substring (1- (point)) (point-at-bol)))
+ (setq tag-text (buffer-substring (1- (point)) (line-beginning-position)))
;; If use-explicit is non-nil and explicit tag is present, use it as part of
;; return value. Else just skip it.
(setq explicit-start (point))
- (when (and (search-forward "\001" (point-at-bol 2) t)
+ (when (and (search-forward "\001" (line-beginning-position 2) t)
use-explicit)
(setq tag-text (buffer-substring explicit-start (1- (point)))))
(when glasses-separate-parentheses-p
(goto-char beg)
(while (re-search-forward "[a-zA-Z]_*\\((\\)" end t)
- (unless (glasses-parenthesis-exception-p (point-at-bol) (match-end 1))
+ (unless (glasses-parenthesis-exception-p (line-beginning-position)
+ (match-end 1))
(glasses-make-overlay (match-beginning 1) (match-end 1)
'glasses-parenthesis))))))))
(when glasses-separate-parentheses-p
(goto-char (point-min))
(while (re-search-forward "[a-zA-Z]_*\\( \\)(" nil t)
- (unless (glasses-parenthesis-exception-p (point-at-bol) (1+ (match-end 1)))
+ (unless (glasses-parenthesis-exception-p (line-beginning-position)
+ (1+ (match-end 1)))
(replace-match "" t nil nil 1)))))))
;; nil must be returned to allow use in write file hooks
nil)
(arg (if up arg (- arg))))
(if (eq t idlwave-shell-arrows-do-history) (goto-char proc-pos))
(if (and idlwave-shell-arrows-do-history
- (>= (1+ (point-at-eol)) proc-pos))
+ (>= (1+ (line-end-position)) proc-pos))
(comint-previous-input arg)
(forward-line (- arg)))))
(defun idlwave-shell-filename-string ()
"Return t if in a string and after what could be a file name."
- (let ((limit (point-at-bol)))
+ (let ((limit (line-beginning-position)))
(save-excursion
;; Skip backwards over file name chars
(skip-chars-backward idlwave-shell-file-name-chars limit)
(defun idlwave-shell-batch-command ()
"Return t if we're in a batch command statement like \"@foo\"."
- (let ((limit (point-at-bol)))
+ (let ((limit (line-beginning-position)))
(save-excursion
;; Skip backwards over filename
(skip-chars-backward idlwave-shell-file-name-chars limit)
idlwave-shell-electric-stop-line-face
idlwave-shell-stop-line-face))
(move-overlay idlwave-shell-stop-line-overlay
- (point) (point-at-eol)
+ (point) (line-end-position)
(current-buffer)))
;; use the arrow instead, but only if marking is wanted.
(if idlwave-shell-mark-stop-line
(list (idlwave-shell-file-name (buffer-file-name))
(save-restriction
(widen)
- (1+ (count-lines 1 (point-at-bol)))))))
+ (1+ (count-lines 1 (line-beginning-position)))))))
(defun idlwave-shell-current-module ()
"Return the name of the module for the current file.
(while (setq bp (pop bp-list))
(save-excursion
(idlwave-shell-goto-frame (car bp))
- (let* ((end (point-at-eol))
+ (let* ((end (line-end-position))
(beg (progn (beginning-of-line 1) (point)))
(condition (idlwave-shell-bp-get bp 'condition))
(count (idlwave-shell-bp-get bp 'count))
(append
;; compiled procedures
(progn
- (narrow-to-region cpro (point-at-bol))
+ (narrow-to-region cpro (line-beginning-position))
(goto-char (point-min))
(idlwave-shell-sources-grep))
;; compiled functions
Moves to end of line if there is no comment delimiter.
Ignores comment delimiters in strings.
Returns point if comment found and nil otherwise."
- (let ((eos (point-at-eol))
+ (let ((eos (line-end-position))
(data (match-data))
found)
;; Look for first comment delimiter not in a string
;;(backward-char 1)
(let* ((pos (point-marker))
(last-abbrev-marker (copy-marker last-abbrev-location))
- (eol-pos (point-at-eol))
+ (eol-pos (line-end-position))
begin-pos end-pos end end1 )
(if idlwave-reindent-end (idlwave-indent-line))
(setq last-abbrev-location (marker-position last-abbrev-marker))
(beginning-of-line)
(setq bcl (point))
(re-search-forward (concat "^[ \t]*" comment-start "+")
- (point-at-eol) t)
+ (line-end-position) t)
;; Get the comment leader on the line and its length
(setq pre (current-column))
;; the comment leader is the indentation plus exactly the
(setq fill-prefix-reg
(concat
(setq fill-prefix
- (regexp-quote (buffer-substring (point-at-bol) (point))))
+ (regexp-quote (buffer-substring (line-beginning-position)
+ (point))))
"[^;]"))
;; Mark the beginning and end of the paragraph
(setq indent hang)
(beginning-of-line)
(while (> (point) start)
- (re-search-forward comment-start-skip (point-at-eol) t)
+ (re-search-forward comment-start-skip (line-end-position) t)
(if (> (setq diff (- indent (current-column))) 0)
(progn
(if (>= here (point))
(setq indent
(min indent
(progn
- (re-search-forward comment-start-skip (point-at-eol) t)
+ (re-search-forward comment-start-skip (line-end-position) t)
(current-column))))
(forward-line -1)))
(setq fill-prefix (concat fill-prefix
(setq first-indent
(max
(progn
- (re-search-forward comment-start-skip (point-at-eol) t)
+ (re-search-forward comment-start-skip (line-end-position) t)
(current-column))
indent))
(if idlwave-use-last-hang-indent
(save-excursion
(end-of-line)
- (if (re-search-backward idlwave-hang-indent-regexp (point-at-bol) t)
+ (if (re-search-backward idlwave-hang-indent-regexp (line-beginning-position) t)
(+ (current-column) (length idlwave-hang-indent-regexp))))
(save-excursion
(beginning-of-line)
- (if (re-search-forward idlwave-hang-indent-regexp (point-at-eol) t)
+ (if (re-search-forward idlwave-hang-indent-regexp (line-end-position) t)
(current-column)))))
(defun idlwave-auto-fill ()
;; Remove whitespace between comment delimiter and
;; text, insert spaces for appropriate indentation.
(beginning-of-line)
- (re-search-forward comment-start-skip (point-at-eol) t)
+ (re-search-forward comment-start-skip (line-end-position) t)
(delete-horizontal-space)
(idlwave-indent-to indent)
(goto-char (- (point-max) here)))))
;; Because single and double quotes can quote each other we must
;; search for the string start from the beginning of line.
(let* ((start (point))
- (eol (point-at-eol))
+ (eol (line-end-position))
(bq (progn (beginning-of-line) (point)))
(endq (point))
(data (match-data))
(setq s1 (downcase s1) s2 (downcase s2)))
(idlwave-abbrev-change-case
(setq s1 (upcase s1) s2 (upcase s2))))
- (let ((beg (point-at-bol))
+ (let ((beg (line-beginning-position))
end)
(if (not (looking-at "\\s-*\n"))
(open-line 1))
(setq str-terminator ?/))
(re-search-forward
(concat "\\([^\\]\\|^\\)" (string str-terminator))
- (point-at-eol) t))
+ (line-end-position) t))
((nth 7 parse)
(forward-line))
((or (nth 4 parse)
(insert "=")
(goto-char (match-beginning 2)))
(setq js--tmp-location nil)
- (goto-char (point-at-eol)))
+ (goto-char (line-end-position)))
(when js--tmp-location
(save-excursion
(goto-char js--tmp-location)
(looking-at "[ \t\n]*}"))
(save-excursion
(backward-list) (forward-symbol -1) (looking-at "\\_<do\\_>"))
- (js--re-search-backward "\\_<do\\_>" (point-at-bol) t)
+ (js--re-search-backward "\\_<do\\_>" (line-beginning-position) t)
(or (looking-at "\\_<do\\_>")
(let ((saved-indent (current-indentation)))
(while (and (js--re-search-backward "^\\s-*\\_<" nil t)
(/= (current-indentation) saved-indent)))
(and (looking-at "\\s-*\\_<do\\_>")
(not (js--re-search-forward
- "\\_<while\\_>" (point-at-eol) t))
+ "\\_<while\\_>" (line-end-position) t))
(= (current-indentation) saved-indent)))))))))
(save-excursion
(back-to-indentation)
(when (save-excursion
- (and (not (eq (point-at-bol) (point-min)))
+ (and (not (eq (line-beginning-position) (point-min)))
(not (looking-at "[{]"))
(js--re-search-backward "[[:graph:]]" nil t)
(progn
(c-get-syntactic-indentation (list (cons symbol anchor)))))
(defun js--same-line (pos)
- (and (>= pos (point-at-bol))
- (<= pos (point-at-eol))))
+ (and (>= pos (line-beginning-position))
+ (<= pos (line-end-position))))
(defun js--multi-line-declaration-indentation ()
"Helper function for `js--proper-indentation'.
"Indent the current line as JavaScript."
(interactive)
(let* ((parse-status
- (save-excursion (syntax-ppss (point-at-bol))))
+ (save-excursion (syntax-ppss (line-beginning-position))))
(offset (- (point) (save-excursion (back-to-indentation) (point)))))
(unless (nth 3 parse-status)
(indent-line-to (js--proper-indentation parse-status))
(looking-at meta-ignore-comment-regexp))
(current-indentation))
;; Beginning of buffer.
- ((eq (point-at-bol) (point-min))
+ ((eq (line-beginning-position) (point-min))
0)
;; Backindent at end of environments.
((meta-indent-looking-at-code
(end-of-line)
;; Skip backward the comments.
(let ((point-not-in-string (point)))
- (while (search-backward comment-start (point-at-bol) t)
+ (while (search-backward comment-start (line-beginning-position) t)
(unless (meta-indent-in-string-p)
(setq point-not-in-string (point))))
(goto-char point-not-in-string))
;; Search for the end of the previous expression.
- (if (search-backward ";" (point-at-bol) t)
+ (if (search-backward ";" (line-beginning-position) t)
(progn (while (and (meta-indent-in-string-p)
- (search-backward ";" (point-at-bol) t)))
+ (search-backward ";" (line-beginning-position) t)))
(if (= (char-after) ?\;)
(forward-char)
(beginning-of-line)))
(while (and (> nest 0)
(re-search-forward
"[:=]\\|\\(\\<record\\>\\)\\|\\(\\<end\\>\\)"
- (point-at-eol 2) t))
+ (line-end-position 2) t))
(cond ((match-beginning 1) (setq nest (1+ nest)))
((match-beginning 2) (setq nest (1- nest)))
((looking-at "[^(\n]+)") (setq nest 0))))))
(defun pascal-declaration-beg ()
(let ((nest 1))
(while (and (> nest 0)
- (re-search-backward "[:=]\\|\\<\\(type\\|var\\|label\\|const\\)\\>\\|\\(\\<record\\>\\)\\|\\(\\<end\\>\\)" (point-at-bol 0) t))
+ (re-search-backward "[:=]\\|\\<\\(type\\|var\\|label\\|const\\)\\>\\|\\(\\<record\\>\\)\\|\\(\\<end\\>\\)"
+ (line-beginning-position 0) t))
(cond ((match-beginning 1) (setq nest 0))
((match-beginning 2) (setq nest (1- nest)))
((match-beginning 3) (setq nest (1+ nest)))))
(defsubst pascal-within-string ()
- (nth 3 (parse-partial-sexp (point-at-bol) (point))))
+ (nth 3 (parse-partial-sexp (line-beginning-position) (point))))
;;;###autoload
(forward-char 1)
(delete-horizontal-space))
((and (looking-at "(\\*\\|\\*[^)]")
- (not (save-excursion (search-forward "*)" (point-at-eol) t))))
+ (not (save-excursion (search-forward "*)" (line-end-position) t))))
(setq setstar t))))
;; If last line was a star comment line then this one shall be too.
(if (null setstar)
(if (and (looking-at "\\<end;")
(not (save-excursion
(end-of-line)
- (search-backward "{" (point-at-bol) t))))
+ (search-backward "{" (line-beginning-position) t))))
(let ((type (car (pascal-calculate-indent))))
(if (eq type 'declaration)
()
(stpos (progn (goto-char (scan-lists (point) -1 1)) (point)))
(stcol (1+ (current-column)))
(edpos (progn (pascal-declaration-end)
- (search-backward ")" (point-at-bol) t)
+ (search-backward ")" (line-beginning-position) t)
(point)))
(usevar (re-search-backward "\\<var\\>" stpos t)))
(if arg (progn
(setq pascal--extra-indent (pascal-get-lineup-indent stpos edpos lineup))
(goto-char stpos)
(while (and (<= (point) edpos) (not (eobp)))
- (if (search-forward lineup (point-at-eol) 'move)
+ (if (search-forward lineup (line-end-position) 'move)
(forward-char -1))
(delete-horizontal-space)
(indent-to pascal--extra-indent)
(goto-char b)
;; Get rightmost position
(while (< (point) e)
- (and (re-search-forward reg (min e (point-at-eol 2)) 'move)
+ (and (re-search-forward reg (min e (line-end-position 2)) 'move)
(cond ((match-beginning 1)
;; Skip record blocks
(pascal-declaration-end))
;; Search through all reachable functions
(while (pascal-beg-of-defun)
- (if (re-search-forward pascal-str (point-at-eol) t)
+ (if (re-search-forward pascal-str (line-end-position) t)
(progn (setq match (buffer-substring (match-beginning 2)
(match-end 2)))
(push match pascal-all)))
match)
;; Traverse lines
(while (< (point) end)
- (if (re-search-forward "[:=]" (point-at-eol) t)
+ (if (re-search-forward "[:=]" (line-end-position) t)
;; Traverse current line
(while (and (re-search-backward
(concat "\\((\\|\\<\\(var\\|type\\|const\\)\\>\\)\\|"
pascal-symbol-re)
- (point-at-bol) t)
+ (line-beginning-position) t)
(not (match-end 1)))
(setq match (buffer-substring (match-beginning 0) (match-end 0)))
(if (string-match (concat "\\<" pascal-str) match)
(push match pascal-all))))
- (if (re-search-forward "\\<record\\>" (point-at-eol) t)
+ (if (re-search-forward "\\<record\\>" (line-end-position) t)
(pascal-declaration-end)
(forward-line 1)))
(if (> start (prog1 (save-excursion (pascal-end-of-defun)
(point))))
() ; Declarations not reachable
- (if (search-forward "(" (point-at-eol) t)
+ (if (search-forward "(" (line-end-position) t)
;; Check parameterlist
;; FIXME: pascal-get-completion-decl doesn't understand
;; the var declarations in parameter lists :-(
(or (eq state 'declaration) (eq state 'paramlist)
(and (eq state 'defun)
(save-excursion
- (re-search-backward ")[ \t]*:" (point-at-bol) t))))
+ (re-search-backward ")[ \t]*:" (line-beginning-position) t))))
(save-excursion
(if (or (eq state 'paramlist) (eq state 'defun))
(pascal-beg-of-defun))
(backward-paragraph)
(unless (bobp) (forward-line))
(if (string-match "^/\\*[^a-zA-Z]*$" (thing-at-point 'line))
- (narrow-to-region (point-at-eol) (point-max))))
+ (narrow-to-region (line-end-position) (point-max))))
(save-excursion
(forward-paragraph)
(forward-line -1)
(if (string-match "^[^a-zA-Z]*\\*/$" (thing-at-point 'line))
- (narrow-to-region (point-min) (point-at-bol))))
+ (narrow-to-region (point-min) (line-beginning-position))))
(let ((fill-prefix (prolog-guess-fill-prefix)))
(fill-paragraph nil))))
)))
(setq re (regexp-quote (or (match-string 4) (match-string 2))))
(if (match-beginning 1) (setq re (concat "\\s *" re)))
(let* ((id-end (goto-char (match-end 0)))
- (line-end-position (point-at-eol))
+ (line-end-position (line-end-position))
(state (list in-string nest depth pcol indent)))
;; parse the rest of the line
(while (and (> line-end-position (point))
(save-excursion
(forward-char -1)
(looking-back ruby-syntax-before-regexp-re
- (point-at-bol))))
+ (line-beginning-position))))
;; End of regexp. We don't match the whole
;; regexp at once because it can have
;; string interpolation inside, or span
;;
(defsubst verilog-within-string ()
- (nth 3 (parse-partial-sexp (point-at-bol) (point))))
+ (nth 3 (parse-partial-sexp (line-beginning-position) (point))))
(defsubst verilog-string-match-fold (regexp string &optional start)
"Like `string-match', but use `verilog-case-fold'.
(search-forward substr bound noerror))
(save-excursion
(beginning-of-line)
- (setq done (re-search-forward regexp (point-at-eol) noerror)))
+ (setq done (re-search-forward regexp (line-end-position) noerror)))
(unless (and (<= (match-beginning 0) (point))
(>= (match-end 0) (point)))
(setq done nil)))
(search-backward substr bound noerror))
(save-excursion
(end-of-line)
- (setq done (re-search-backward regexp (point-at-bol) noerror)))
+ (setq done (re-search-backward regexp (line-beginning-position) noerror)))
(unless (and (<= (match-beginning 0) (point))
(>= (match-end 0) (point)))
(setq done nil)))
(or kill-existing-comment
(not (save-excursion
(end-of-line)
- (search-backward "//" (point-at-bol) t)))))
+ (search-backward "//" (line-beginning-position) t)))))
(let ((nest 1) b e
m
(else (if (match-end 2) "!" " ")))
(or kill-existing-comment
(not (save-excursion
(end-of-line)
- (search-backward "//" (point-at-bol) t)))))
+ (search-backward "//" (line-beginning-position) t)))))
(let ((type (car indent-str)))
(unless (eq type 'declaration)
(unless (looking-at (concat "\\(" verilog-end-block-ordered-re "\\)[ \t]*:")) ; ignore named ends
(cond
((looking-at "// surefire lint_off_line ")
(goto-char (match-end 0))
- (let ((lim (point-at-eol)))
+ (let ((lim (line-end-position)))
(if (re-search-forward code lim 'move)
(throw 'already t)
(insert (concat " " code)))))
(verilog-point-text) filename))
(goto-char (point-min))
(while (not (eobp))
- (setq line (buffer-substring (point) (point-at-eol)))
+ (setq line (buffer-substring (point) (line-end-position)))
(forward-line 1)
(when (string-match "//" line)
(setq line (substring line 0 (match-beginning 0))))
(verilog-save-scan-cache
(let (end-point)
(goto-char end)
- (setq end-point (point-at-eol))
+ (setq end-point (line-end-position))
(goto-char beg)
(beginning-of-line) ; scan entire line
;; delete overlays existing on this line
(save-excursion
(goto-char begin)
(let (element
- (eol (point-at-eol)))
+ (eol (line-end-position)))
(setq element (nth 0 copy))
(when (and (or (and (listp (car element))
(memq major-mode (car element)))
;; Determine the greatest whitespace distance to the alignment
;; character
(goto-char begin)
- (setq eol (point-at-eol)
+ (setq eol (line-end-position)
bol (setq begin (progn (beginning-of-line) (point))))
(while (< bol end)
(save-excursion
(setq max distance))))
(forward-line)
(setq bol (point)
- eol (point-at-eol))
+ eol (line-end-position))
(setq lines (1+ lines)))
;; Now insert enough maxs to push each assignment operator to
;; the same column. We need to use 'lines' as a counter, since
;; the location of the mark may change
(goto-char (setq bol begin))
- (setq eol (point-at-eol))
+ (setq eol (line-end-position))
(while (> lines 0)
(when (and (vhdl-re-search-forward match eol t)
(save-excursion
(beginning-of-line)
(forward-line)
(setq bol (point)
- eol (point-at-eol))
+ eol (line-end-position))
(setq lines (1- lines))))))
(defun vhdl-align-region-groups (beg end &optional spacing
(forward-char)
(vhdl-forward-syntactic-ws))
(goto-char end)
- (when (> pos (point-at-eol))
+ (when (> pos (line-end-position))
(error "ERROR: Not within a generic/port clause"))
;; delete closing parenthesis on separate line (not supported style)
(when (save-excursion (beginning-of-line) (looking-at "^\\s-*);"))
"Return the line number of the line containing point."
(save-restriction
(widen)
- (1+ (count-lines (point-min) (point-at-bol)))))
+ (1+ (count-lines (point-min) (line-beginning-position)))))
(defun vhdl-line-kill-entire (&optional arg)
"Delete entire line."
"Copy current line."
(interactive "p")
(save-excursion
- (let ((position (point-at-bol)))
+ (let ((position (line-beginning-position)))
(forward-line (or arg 1))
(copy-region-as-kill position (point)))))
(let ((ent-alist ent-alist-arg)
(conf-alist conf-alist-arg)
(margin (current-indentation))
- (beg (point-at-bol))
+ (beg (line-beginning-position))
ent-entry inst-entry inst-path inst-prev-path tmp-alist) ;; cons-key
;; insert block configuration (for architecture)
(vhdl-insert-keyword "FOR ") (insert arch-name "\n")
(point)))))
(defun delete-extract-rectangle-line (startcol endcol lines fill)
- (let ((pt (point-at-eol)))
+ (let ((pt (line-end-position)))
(if (< (move-to-column startcol (if fill t 'coerce)) startcol)
(setcdr lines (cons (spaces-string (- endcol startcol))
(cdr lines)))
(defun open-rectangle-line (startcol endcol fill)
(when (= (move-to-column startcol (if fill t 'coerce)) startcol)
(unless (and (not fill)
- (= (point) (point-at-eol)))
+ (= (point) (line-end-position)))
(indent-to endcol))))
(defun delete-whitespace-rectangle-line (startcol _endcol fill)
(when (= (move-to-column startcol (if fill t 'coerce)) startcol)
- (unless (= (point) (point-at-eol))
- (delete-region (point) (progn (skip-syntax-forward " " (point-at-eol))
+ (unless (= (point) (line-end-position))
+ (delete-region (point) (progn (skip-syntax-forward " " (line-end-position))
(point))))))
;;;###autoload
(apply-on-rectangle 'clear-rectangle-line start end fill))
(defun clear-rectangle-line (startcol endcol fill)
- (let ((pt (point-at-eol)))
+ (let ((pt (line-end-position)))
(when (= (move-to-column startcol (if fill t 'coerce)) startcol)
(if (and (not fill)
(<= (save-excursion (goto-char pt) (current-column)) endcol))
(defalias 'store-match-data #'set-match-data)
(defalias 'chmod #'set-file-modes)
(defalias 'mkdir #'make-directory)
-;; These are the XEmacs names:
-(defalias 'point-at-eol #'line-end-position)
-(defalias 'point-at-bol #'line-beginning-position)
-(define-obsolete-function-alias 'user-original-login-name
- #'user-login-name "28.1")
+;; These were the XEmacs names, now obsolete:
+(define-obsolete-function-alias 'point-at-eol #'line-end-position "29.1")
+(define-obsolete-function-alias 'point-at-bol #'line-beginning-position "29.1")
+(define-obsolete-function-alias 'user-original-login-name #'user-login-name "28.1")
;; These are in obsolete/autoload.el, but are commonly used by
;; third-party scripts that assume that they exist without requiring
(defun term-move-to-column (column)
(setq term-current-column column)
- (let ((point-at-eol (line-end-position)))
+ (let ((line-end-position (line-end-position)))
(move-to-column term-current-column t)
;; If move-to-column extends the current line it will use the face
;; from the last character on the line, set the face for the chars
;; to default.
- (when (> (point) point-at-eol)
- (put-text-property point-at-eol (point) 'font-lock-face 'default))))
+ (when (> (point) line-end-position)
+ (put-text-property line-end-position (point) 'font-lock-face 'default))))
;; Move DELTA column right (or left if delta < 0 limiting at column 0).
(defun term-move-columns (delta)
;; comment.
(when (save-excursion
(beginning-of-line)
- (comment-search-forward (point-at-eol) t))
+ (comment-search-forward (line-end-position) t))
(goto-char (match-end 0)))
(let ((ppss (syntax-ppss))
(eol (line-end-position)))
(goto-char (point-min))
;; Localwords parsing copied from ispell.el.
(while (search-forward ispell-words-keyword nil t)
- (let ((end (point-at-eol))
+ (let ((end (line-end-position))
string)
;; buffer-local words separated by a space, and can contain
;; any character other than a space. Not rigorous enough.
(min skip-region-start ispell-region-end)
(marker-position ispell-region-end))))
(let* ((ispell-start (point))
- (ispell-end (min (point-at-eol) reg-end))
+ (ispell-end (min (line-end-position) reg-end))
;; See if line must be prefixed by comment string to let ispell know this is
;; part of a comment string. This is only supported in some modes.
;; In particular, this is not supported in autoconf mode where adding the
ispell-start ispell-end add-comment)))
(ispell-print-if-debug
"ispell-region: string pos (%s->%s), eol: %s, [in-comment]: [%s], [add-comment]: [%s], [string]: [%s]\n"
- ispell-start ispell-end (point-at-eol) in-comment add-comment string)
+ ispell-start ispell-end (line-end-position)
+ in-comment add-comment string)
(if add-comment ; account for comment chars added
(setq ispell-start (- ispell-start (length add-comment))
;; Reset `in-comment' (and indirectly `add-comment') for new line
(goto-char (point-max))
;; Uses last occurrence of ispell-parsing-keyword
(if (search-backward ispell-parsing-keyword nil t)
- (let ((end (point-at-eol))
+ (let ((end (line-end-position))
string)
(search-forward ispell-parsing-keyword)
(while (re-search-forward " *\\([^ \"]+\\)" end t)
(if (search-backward ispell-dictionary-keyword nil t)
(progn
(search-forward ispell-dictionary-keyword)
- (setq end (point-at-eol))
+ (setq end (line-end-position))
(if (re-search-forward " *\\([^ \"]+\\)" end t)
(setq ispell-local-dictionary
(match-string-no-properties 1))))))
(if (search-backward ispell-pdict-keyword nil t)
(progn
(search-forward ispell-pdict-keyword)
- (setq end (point-at-eol))
+ (setq end (line-end-position))
(if (re-search-forward " *\\([^ \"]+\\)" end t)
(setq ispell-local-pdict
(match-string-no-properties 1)))))))
(while (search-forward ispell-words-keyword nil t)
(or ispell-buffer-local-name
(setq ispell-buffer-local-name (buffer-name)))
- (let ((end (point-at-eol))
+ (let ((end (line-end-position))
(ispell-casechars (ispell-get-casechars))
string)
;; buffer-local words separated by a space, and can contain
nil
(cond
;; parenthesis
- ((looking-back "([^)]*" (point-at-bol 0))
+ ((looking-back "([^)]*" (line-beginning-position 0))
"@pxref{")
;; beginning of sentence or buffer
- ((or (looking-back (sentence-end) (point-at-bol 0))
+ ((or (looking-back (sentence-end) (line-beginning-position 0))
(= (point) (point-min)))
"@xref{")
;; bol or eol
"@ref{")
;; inside word
((not (eq (char-syntax (char-after)) ? ))
- (skip-syntax-backward "^ " (point-at-bol))
+ (skip-syntax-backward "^ " (line-beginning-position))
"@ref{")
;; everything else
(t
(when (looking-at regexp-hunk) ; Hunk header.
(throw 'headerp (point)))
(forward-line -1)
- (when (re-search-forward regexp-file (point-at-eol 4) t) ; File header.
+ (when (re-search-forward regexp-file (line-end-position 4) t) ; File header.
(forward-line 0)
(throw 'headerp (point)))
(goto-char orig)
;; should cover the common cases. Remember that we fall back
;; to regular hg commands if we see something we don't like.
(save-restriction
- (narrow-to-region (point) (point-at-eol))
+ (narrow-to-region (point) (line-end-position))
(cond ((looking-at "[ \t]*\\(?:#.*\\)?$"))
((looking-at "syntax:[ \t]*re[ \t]*$")
(setf default-syntax 'vc-hg--hgignore-add-pcre))
;; Filter localized strings
((looking-at (rx (group-n 1 (+ (in alnum "-"))) (* blank) "[")))
(t (error "Malformed line: %s"
- (buffer-substring (point) (point-at-eol)))))
+ (buffer-substring (point) (line-end-position)))))
(forward-line))
res))
(forward-line))
(unless (looking-at xdg-desktop-group-regexp)
(error "Expected group name! Instead saw: %s"
- (buffer-substring (point) (point-at-eol))))
+ (buffer-substring (point) (line-end-position))))
(when group
(while (and (re-search-forward xdg-desktop-group-regexp nil t)
(not (equal (match-string 1) group)))))