diff options
Diffstat (limited to 'lisp/progmodes')
-rw-r--r-- | lisp/progmodes/cfengine.el | 4 | ||||
-rw-r--r-- | lisp/progmodes/cperl-mode.el | 33 | ||||
-rw-r--r-- | lisp/progmodes/elisp-mode.el | 2 | ||||
-rw-r--r-- | lisp/progmodes/etags.el | 6 | ||||
-rw-r--r-- | lisp/progmodes/glasses.el | 6 | ||||
-rw-r--r-- | lisp/progmodes/idlw-shell.el | 14 | ||||
-rw-r--r-- | lisp/progmodes/idlwave.el | 25 | ||||
-rw-r--r-- | lisp/progmodes/js.el | 16 | ||||
-rw-r--r-- | lisp/progmodes/meta-mode.el | 8 | ||||
-rw-r--r-- | lisp/progmodes/pascal.el | 29 | ||||
-rw-r--r-- | lisp/progmodes/prolog.el | 4 | ||||
-rw-r--r-- | lisp/progmodes/ruby-mode.el | 4 | ||||
-rw-r--r-- | lisp/progmodes/verilog-mode.el | 16 | ||||
-rw-r--r-- | lisp/progmodes/vhdl-mode.el | 18 |
14 files changed, 95 insertions, 90 deletions
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el index 32031d19462..7d7e9265380 100644 --- a/lisp/progmodes/cfengine.el +++ b/lisp/progmodes/cfengine.el @@ -1186,7 +1186,7 @@ Intended as the value of `indent-line-function'." (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)))))) @@ -1285,7 +1285,7 @@ see. Use it by enabling `eldoc-mode'." "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))) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 2a7bbf01058..ba0adcc913f 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -2081,7 +2081,7 @@ Affected by `cperl-electric-parens'." "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)) @@ -2224,7 +2224,7 @@ to nil." "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 "{;:")) @@ -2264,8 +2264,8 @@ to 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 "{...}" @@ -2343,8 +2343,8 @@ If in POD, insert appropriate lines." (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) @@ -2823,7 +2823,7 @@ Will not look before LIM." (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 @@ -2866,7 +2866,7 @@ Will not look before LIM." (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 @@ -3109,7 +3109,7 @@ comment." 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) @@ -4020,7 +4020,8 @@ recursive calls in starting lines of here-documents." "") 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 "^[.;]$"))) @@ -4996,7 +4997,7 @@ If `cperl-indent-region-fix-constructs', will improve spacing on 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) @@ -5046,9 +5047,9 @@ conditional/loop constructs." "\\<\\(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 @@ -5061,7 +5062,7 @@ Returns some position at the last line." (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) @@ -5237,7 +5238,7 @@ Returns some position at the last line." (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 @@ -7282,7 +7283,7 @@ Currently it is tuned to C and Perl syntax." ;; 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 diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 0c4a9bfdbea..4617a01947c 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -1899,7 +1899,7 @@ or elsewhere, return a 1-line docstring." ;; 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) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 7766694edff..65bc42c0996 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -1144,7 +1144,7 @@ error message." ;; 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 @@ -1314,11 +1314,11 @@ buffer-local values of tags table format variables." ;; 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))))) diff --git a/lisp/progmodes/glasses.el b/lisp/progmodes/glasses.el index f760ccf3686..c7b05873369 100644 --- a/lisp/progmodes/glasses.el +++ b/lisp/progmodes/glasses.el @@ -243,7 +243,8 @@ CATEGORY is the overlay category. If it is nil, use the `glasses' category." (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)))))))) @@ -282,7 +283,8 @@ recognized according to the current value of the variable `glasses-separator'." (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) diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index d21a9faec9d..63f032b7b39 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -1381,7 +1381,7 @@ Otherwise just move the line. Move down unless UP is non-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))))) @@ -2130,7 +2130,7 @@ args of an executive .run, .rnew or .compile." (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) @@ -2139,7 +2139,7 @@ args of an executive .run, .rnew or .compile." (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) @@ -2317,7 +2317,7 @@ matter what the settings of that variable." 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 @@ -2510,7 +2510,7 @@ If in the IDL shell buffer, returns `idlwave-shell-pc-frame'." (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. @@ -3528,7 +3528,7 @@ Existing overlays are recycled, in order to minimize consumption." (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)) @@ -3851,7 +3851,7 @@ of the form: (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 diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index b290854e1b9..81f74dc1fa1 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -2004,7 +2004,7 @@ Returns non-nil if abbrev is left expanded." 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 @@ -2054,7 +2054,7 @@ Also checks if the correct END statement has been used." ;;(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)) @@ -3202,7 +3202,7 @@ ignored." (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 @@ -3210,7 +3210,8 @@ ignored." (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 @@ -3264,7 +3265,7 @@ ignored." (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)) @@ -3286,7 +3287,7 @@ ignored." (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 @@ -3296,7 +3297,7 @@ ignored." (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)) @@ -3334,11 +3335,11 @@ If not found returns nil." (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 () @@ -3386,7 +3387,7 @@ if `idlwave-auto-fill-split-string' is non-nil." ;; 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))))) @@ -3548,7 +3549,7 @@ constants - a double quote followed by an octal digit." ;; 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)) @@ -3626,7 +3627,7 @@ unless the optional second argument NOINDENT is non-nil." (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)) diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index efad3b52aa9..b920ef6c2cc 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -812,7 +812,7 @@ point at BOB." (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) @@ -1683,7 +1683,7 @@ point of view of font-lock. It applies highlighting directly with (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) @@ -2506,14 +2506,14 @@ the same column as the current line." (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))))))))) @@ -2525,7 +2525,7 @@ nil." (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 @@ -2546,8 +2546,8 @@ nil." (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'. @@ -2921,7 +2921,7 @@ return nil." "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)) diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el index 30d37cf7ecd..00bab00a0d4 100644 --- a/lisp/progmodes/meta-mode.el +++ b/lisp/progmodes/meta-mode.el @@ -520,7 +520,7 @@ If the list was changed, sort the list and remove duplicates first." (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 @@ -558,14 +558,14 @@ If the list was changed, sort the list and remove duplicates first." (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))) diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el index 8d3194e6a47..9786b1aa455 100644 --- a/lisp/progmodes/pascal.el +++ b/lisp/progmodes/pascal.el @@ -274,7 +274,7 @@ are handled in another way, and should not be added to this list." (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)))))) @@ -283,7 +283,8 @@ are handled in another way, and should not be added to this list." (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))))) @@ -291,7 +292,7 @@ are handled in another way, and should not be added to this list." (defsubst pascal-within-string () - (nth 3 (parse-partial-sexp (point-at-bol) (point)))) + (nth 3 (parse-partial-sexp (line-beginning-position) (point)))) ;;;###autoload @@ -388,7 +389,7 @@ See also the user variables `pascal-type-keywords', `pascal-start-keywords' and (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) @@ -707,7 +708,7 @@ on the line which ends a function or procedure named NAME." (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) () @@ -979,7 +980,7 @@ indent of the current line in parameterlist." (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 @@ -1026,7 +1027,7 @@ indent of the current line in parameterlist." (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) @@ -1053,7 +1054,7 @@ indent of the current line in parameterlist." (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)) @@ -1117,7 +1118,7 @@ indent of the current line in parameterlist." ;; 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))) @@ -1134,17 +1135,17 @@ indent of the current line in parameterlist." 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))) @@ -1187,7 +1188,7 @@ indent of the current line in parameterlist." (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 :-( @@ -1245,7 +1246,7 @@ indent of the current line in parameterlist." (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)) diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index 6437bbd4c1c..f8edc2b1f7b 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -2282,12 +2282,12 @@ between them)." (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)))) ))) diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 87bb92908d1..955daa393ce 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1147,7 +1147,7 @@ delimiter." (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)) @@ -1924,7 +1924,7 @@ It will be properly highlighted even when the call omits parens.") (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 diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index f063fb5a7ca..fa799a0fb37 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -1824,7 +1824,7 @@ If set will become buffer local.") ;; (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'. @@ -1927,7 +1927,7 @@ This speeds up complicated regexp matches." (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))) @@ -1947,7 +1947,7 @@ This speeds up complicated regexp matches." (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))) @@ -4908,7 +4908,7 @@ primitive or interface named NAME." (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) "!" " "))) @@ -4961,7 +4961,7 @@ primitive or interface named NAME." (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 @@ -5503,7 +5503,7 @@ becomes: (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))))) @@ -9958,7 +9958,7 @@ Use DEFAULT-DIR to anchor paths if non-nil." (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)))) @@ -14758,7 +14758,7 @@ Clicking on the middle-mouse button loads them in a buffer (as in dired)." (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 diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 18219db740b..b763da3fbc5 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -7707,7 +7707,7 @@ non-nil, indentation is done before aligning." (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))) @@ -7733,7 +7733,7 @@ space is inserted after the token in MATCH." ;; 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 @@ -7750,13 +7750,13 @@ space is inserted after the token in MATCH." (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 @@ -7776,7 +7776,7 @@ space is inserted after the token in MATCH." (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 @@ -8647,7 +8647,7 @@ buffer." (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-*);")) @@ -12838,7 +12838,7 @@ expressions (e.g. for index ranges of types and signals)." "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." @@ -12855,7 +12855,7 @@ expressions (e.g. for index ranges of types and signals)." "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))))) @@ -16752,7 +16752,7 @@ current project/directory." (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") |