comparison lisp/progmodes/vhdl-mode.el @ 111433:05dc9dca8729

Replace end-of-line, save-excursion etc with point-at-eol, point-at-bol. * lisp/mh-e/mh-seq.el (mh-read-msg-list): Use point-at-eol. * lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-show-infos) (gnus-bookmark-kill-line): Use point-at-eol. * lisp/cedet/ede/proj-elisp.el (ede-proj-flush-autoconf): Use point-at-bol. * lisp/emacs-lisp/chart.el (chart-zap-chars): * lisp/play/decipher.el (decipher-set-map): * lisp/progmodes/ada-mode.el (ada-get-current-indent) (ada-search-ignore-string-comment, ada-tab-hard, ada-untab-hard): * lisp/progmodes/ada-prj.el (ada-prj-load-from-file, ada-prj-display-help): * lisp/progmodes/ada-xref.el (ada-initialize-runtime-library) (ada-get-all-references): * lisp/progmodes/cperl-mode.el (cperl-electric-paren) (cperl-electric-rparen, cperl-electric-keyword, cperl-electric-else) (cperl-linefeed, cperl-sniff-for-indent, cperl-to-comment-or-eol) (cperl-find-pods-heres, cperl-indent-exp, cperl-fix-line-spacing) (cperl-word-at-point-hard): * lisp/progmodes/idlw-shell.el (idlwave-shell-move-or-history) (idlwave-shell-filename-string, idlwave-shell-batch-command) (idlwave-shell-display-line): * lisp/progmodes/idlwave.el (idlwave-show-begin, idlwave-fill-paragraph) (idlwave-calc-hanging-indent, idlwave-auto-fill, idlwave-template): * lisp/progmodes/js.el (js--re-search-forward-inner) (js--re-search-backward-inner): * lisp/progmodes/vhdl-mode.el (vhdl-align-region-1, vhdl-align-region-2) (vhdl-fix-clause, vhdl-compose-configuration-architecture): * lisp/progmodes/ruby-mode.el (ruby-parse-partial, eval-when-compile): * lisp/textmodes/flyspell.el (flyspell-process-localwords): * lisp/textmodes/ispell.el (ispell-buffer-local-parsing) (ispell-buffer-local-dict, ispell-buffer-local-words): Use point-at-bol and point-at-eol.
author Glenn Morris <rgm@gnu.org>
date Sat, 06 Nov 2010 18:36:33 -0700
parents b10051866f51
children 56b71cddc9c5
comparison
equal deleted inserted replaced
111432:8de1e4554e5e 111433:05dc9dca8729
7267 (vhdl-prepare-search-2 7267 (vhdl-prepare-search-2
7268 (while copy 7268 (while copy
7269 (save-excursion 7269 (save-excursion
7270 (goto-char begin) 7270 (goto-char begin)
7271 (let (element 7271 (let (element
7272 (eol (save-excursion (progn (end-of-line) (point))))) 7272 (eol (point-at-eol)))
7273 (setq element (nth 0 copy)) 7273 (setq element (nth 0 copy))
7274 (when (and (or (and (listp (car element)) 7274 (when (and (or (and (listp (car element))
7275 (memq major-mode (car element))) 7275 (memq major-mode (car element)))
7276 (eq major-mode (car element))) 7276 (eq major-mode (car element)))
7277 (or vhdl-align-try-all-clauses 7277 (or vhdl-align-try-all-clauses
7293 (save-excursion 7293 (save-excursion
7294 (let (distance (max 0) (lines 0) bol eol width) 7294 (let (distance (max 0) (lines 0) bol eol width)
7295 ;; Determine the greatest whitespace distance to the alignment 7295 ;; Determine the greatest whitespace distance to the alignment
7296 ;; character 7296 ;; character
7297 (goto-char begin) 7297 (goto-char begin)
7298 (setq eol (progn (end-of-line) (point)) 7298 (setq eol (point-at-eol)
7299 bol (setq begin (progn (beginning-of-line) (point)))) 7299 bol (setq begin (progn (beginning-of-line) (point))))
7300 (while (< bol end) 7300 (while (< bol end)
7301 (save-excursion 7301 (save-excursion
7302 (when (and (re-search-forward match eol t) 7302 (when (and (re-search-forward match eol t)
7303 (not (vhdl-in-literal))) 7303 (not (vhdl-in-literal)))
7304 (setq distance (- (match-beginning substr) bol)) 7304 (setq distance (- (match-beginning substr) bol))
7305 (when (> distance max) 7305 (when (> distance max)
7306 (setq max distance)))) 7306 (setq max distance))))
7307 (forward-line) 7307 (forward-line)
7308 (setq bol (point) 7308 (setq bol (point)
7309 eol (save-excursion (end-of-line) (point))) 7309 eol (point-at-eol))
7310 (setq lines (1+ lines))) 7310 (setq lines (1+ lines)))
7311 ;; Now insert enough maxs to push each assignment operator to 7311 ;; Now insert enough maxs to push each assignment operator to
7312 ;; the same column. We need to use 'lines' as a counter, since 7312 ;; the same column. We need to use 'lines' as a counter, since
7313 ;; the location of the mark may change 7313 ;; the location of the mark may change
7314 (goto-char (setq bol begin)) 7314 (goto-char (setq bol begin))
7315 (setq eol (save-excursion (end-of-line) (point))) 7315 (setq eol (point-at-eol))
7316 (while (> lines 0) 7316 (while (> lines 0)
7317 (when (and (re-search-forward match eol t) 7317 (when (and (re-search-forward match eol t)
7318 (not (vhdl-in-literal))) 7318 (not (vhdl-in-literal)))
7319 (setq width (- (match-end substr) (match-beginning substr))) 7319 (setq width (- (match-end substr) (match-beginning substr)))
7320 (setq distance (- (match-beginning substr) bol)) 7320 (setq distance (- (match-beginning substr) bol))
7322 (delete-char width) 7322 (delete-char width)
7323 (insert-char ? (+ (- max distance) spacing))) 7323 (insert-char ? (+ (- max distance) spacing)))
7324 (beginning-of-line) 7324 (beginning-of-line)
7325 (forward-line) 7325 (forward-line)
7326 (setq bol (point) 7326 (setq bol (point)
7327 eol (save-excursion (end-of-line) (point))) 7327 eol (point-at-eol))
7328 (setq lines (1- lines)))))) 7328 (setq lines (1- lines))))))
7329 7329
7330 (defun vhdl-align-region-groups (beg end &optional spacing 7330 (defun vhdl-align-region-groups (beg end &optional spacing
7331 no-message no-comments) 7331 no-message no-comments)
7332 "Align region, treat groups of lines separately." 7332 "Align region, treat groups of lines separately."
7986 (goto-char (1- (match-end 0))) 7986 (goto-char (1- (match-end 0)))
7987 (setq end (point-marker)) 7987 (setq end (point-marker))
7988 (forward-char) 7988 (forward-char)
7989 (vhdl-forward-syntactic-ws)) 7989 (vhdl-forward-syntactic-ws))
7990 (goto-char end) 7990 (goto-char end)
7991 (when (> pos (save-excursion (end-of-line) (point))) 7991 (when (> pos (point-at-eol))
7992 (error "ERROR: Not within a generic/port clause")) 7992 (error "ERROR: Not within a generic/port clause"))
7993 ;; delete closing parenthesis on separate line (not supported style) 7993 ;; delete closing parenthesis on separate line (not supported style)
7994 (when (save-excursion (beginning-of-line) (looking-at "^\\s-*);")) 7994 (when (save-excursion (beginning-of-line) (looking-at "^\\s-*);"))
7995 (vhdl-line-kill) 7995 (vhdl-line-kill)
7996 (vhdl-backward-syntactic-ws) 7996 (vhdl-backward-syntactic-ws)
15914 15914
15915 (defun vhdl-compose-configuration-architecture (ent-name arch-name inst-alist 15915 (defun vhdl-compose-configuration-architecture (ent-name arch-name inst-alist
15916 &optional insert-conf) 15916 &optional insert-conf)
15917 "Generate block configuration for architecture." 15917 "Generate block configuration for architecture."
15918 (let ((margin (current-indentation)) 15918 (let ((margin (current-indentation))
15919 (beg (save-excursion (beginning-of-line) (point))) 15919 (beg (point-at-bol))
15920 ent-entry inst-entry inst-path inst-prev-path cons-key tmp-alist) 15920 ent-entry inst-entry inst-path inst-prev-path cons-key tmp-alist)
15921 ;; insert block configuration (for architecture) 15921 ;; insert block configuration (for architecture)
15922 (vhdl-insert-keyword "FOR ") (insert arch-name "\n") 15922 (vhdl-insert-keyword "FOR ") (insert arch-name "\n")
15923 (setq margin (+ margin vhdl-basic-offset)) 15923 (setq margin (+ margin vhdl-basic-offset))
15924 ;; process all instances 15924 ;; process all instances
16975 16975
16976 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 16976 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16977 16977
16978 (provide 'vhdl-mode) 16978 (provide 'vhdl-mode)
16979 16979
16980 ;; arch-tag: 780d7073-9b5d-4c6c-b0d8-26b28783aba3
16981 ;;; vhdl-mode.el ends here 16980 ;;; vhdl-mode.el ends here