Mercurial > emacs
comparison lisp/speedbar.el @ 111429:249a1455856a
Use line-end-position rather than end-of-line, etc.
* textmodes/texnfo-upd.el (texinfo-start-menu-description)
(texinfo-update-menu-region-beginning, texinfo-menu-first-node)
(texinfo-delete-existing-pointers, texinfo-find-pointer)
(texinfo-clean-up-node-line, texinfo-insert-node-lines)
(texinfo-multiple-files-update):
* textmodes/table.el (table--probe-cell-left-up)
(table--probe-cell-right-bottom):
* textmodes/picture.el (picture-tab-search):
* textmodes/page-ext.el (pages-copy-header-and-position)
(pages-directory-for-addresses):
* progmodes/vera-mode.el (vera-get-offset):
* progmodes/simula.el (simula-calculate-indent):
* progmodes/python.el (python-pdbtrack-overlay-arrow):
* progmodes/prolog.el (end-of-prolog-clause):
* progmodes/perl-mode.el (perl-calculate-indent, perl-indent-exp):
* progmodes/icon.el (indent-icon-exp):
* progmodes/etags.el (tag-re-match-p):
* progmodes/ebrowse.el (ebrowse-show-file-name-at-point):
* progmodes/ebnf2ps.el (ebnf-begin-file):
* progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-save-local-variable):
* play/life.el (life-setup):
* play/gametree.el (gametree-looking-at-ply):
* nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* mail/sendmail.el (mail-mode-auto-fill):
* emacs-lisp/lisp-mode.el (calculate-lisp-indent):
* emacs-lisp/edebug.el (edebug-overlay-arrow):
* emacs-lisp/checkdoc.el (checkdoc-this-string-valid):
* woman.el (woman-parse-numeric-value, woman2-TH, woman2-SH)
(woman-tab-to-tab-stop, WoMan-warn-ignored):
* type-break.el (type-break-file-keystroke-count):
* term.el (term-replace-by-expanded-history-before-point)
(term-skip-prompt, term-extract-string):
* speedbar.el (speedbar-edit-line, speedbar-expand-line)
(speedbar-contract-line, speedbar-toggle-line-expansion)
(speedbar-parse-c-or-c++tag, speedbar-parse-tex-string)
(speedbar-buffer-revert-buffer, speedbar-highlight-one-tag-line):
* sort.el (sort-skip-fields):
* skeleton.el (skeleton-internal-list):
* simple.el (line-move-finish, line-move-to-column):
* shell.el (shell-forward-command):
* misc.el (copy-from-above-command):
* makesum.el (double-column):
* ebuff-menu.el (electric-buffer-update-highlight):
* dired.el (dired-move-to-end-of-filename):
* dframe.el (dframe-popup-kludge):
* bookmark.el (bookmark-kill-line, bookmark-bmenu-show-filenames):
* arc-mode.el (archive-get-lineno):
Use line-end-position and line-beginning-position.
* net/ange-ftp.el, progmodes/hideif.el, reposition.el:
Same, but only in comments.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sat, 06 Nov 2010 13:23:42 -0700 |
parents | 029e4783cbae |
children | e4200648c86f |
comparison
equal
deleted
inserted
replaced
111428:043aac1cda3c | 111429:249a1455856a |
---|---|
3247 (or (save-excursion | 3247 (or (save-excursion |
3248 (beginning-of-line) | 3248 (beginning-of-line) |
3249 ;; If this fails, then it is a non-standard click, and as such, | 3249 ;; If this fails, then it is a non-standard click, and as such, |
3250 ;; perfectly allowed. | 3250 ;; perfectly allowed. |
3251 (if (re-search-forward "[]>?}] [^ ]" | 3251 (if (re-search-forward "[]>?}] [^ ]" |
3252 (save-excursion (end-of-line) (point)) | 3252 (line-end-position) |
3253 t) | 3253 t) |
3254 (progn | 3254 (progn |
3255 (forward-char -1) | 3255 (forward-char -1) |
3256 (speedbar-do-function-pointer)) | 3256 (speedbar-do-function-pointer)) |
3257 nil)) | 3257 nil)) |
3265 (let* ((dframe-power-click arg) | 3265 (let* ((dframe-power-click arg) |
3266 (speedbar-power-click arg)) | 3266 (speedbar-power-click arg)) |
3267 (condition-case nil | 3267 (condition-case nil |
3268 (progn | 3268 (progn |
3269 (re-search-forward ":\\s-*.\\+. " | 3269 (re-search-forward ":\\s-*.\\+. " |
3270 (save-excursion (end-of-line) (point))) | 3270 (line-end-position)) |
3271 (forward-char -2) | 3271 (forward-char -2) |
3272 (speedbar-do-function-pointer)) | 3272 (speedbar-do-function-pointer)) |
3273 (error (speedbar-position-cursor-on-line))))) | 3273 (error (speedbar-position-cursor-on-line))))) |
3274 | 3274 |
3275 (defun speedbar-flush-expand-line () | 3275 (defun speedbar-flush-expand-line () |
3282 (interactive) | 3282 (interactive) |
3283 (beginning-of-line) | 3283 (beginning-of-line) |
3284 (condition-case nil | 3284 (condition-case nil |
3285 (progn | 3285 (progn |
3286 (re-search-forward ":\\s-*.-. " | 3286 (re-search-forward ":\\s-*.-. " |
3287 (save-excursion (end-of-line) (point))) | 3287 (line-end-position)) |
3288 (forward-char -2) | 3288 (forward-char -2) |
3289 (speedbar-do-function-pointer)) | 3289 (speedbar-do-function-pointer)) |
3290 (error (speedbar-position-cursor-on-line)))) | 3290 (error (speedbar-position-cursor-on-line)))) |
3291 | 3291 |
3292 (defun speedbar-toggle-line-expansion () | 3292 (defun speedbar-toggle-line-expansion () |
3294 (interactive) | 3294 (interactive) |
3295 (beginning-of-line) | 3295 (beginning-of-line) |
3296 (condition-case nil | 3296 (condition-case nil |
3297 (progn | 3297 (progn |
3298 (re-search-forward ":\\s-*.[-+]. " | 3298 (re-search-forward ":\\s-*.[-+]. " |
3299 (save-excursion (end-of-line) (point))) | 3299 (line-end-position)) |
3300 (forward-char -2) | 3300 (forward-char -2) |
3301 (speedbar-do-function-pointer)) | 3301 (speedbar-do-function-pointer)) |
3302 (error (speedbar-position-cursor-on-line)))) | 3302 (error (speedbar-position-cursor-on-line)))) |
3303 | 3303 |
3304 (defun speedbar-expand-line-descendants (&optional arg) | 3304 (defun speedbar-expand-line-descendants (&optional arg) |
3785 nil))) | 3785 nil))) |
3786 | 3786 |
3787 (defun speedbar-parse-c-or-c++tag () | 3787 (defun speedbar-parse-c-or-c++tag () |
3788 "Parse a C or C++ tag, which tends to be a little complex." | 3788 "Parse a C or C++ tag, which tends to be a little complex." |
3789 (save-excursion | 3789 (save-excursion |
3790 (let ((bound (save-excursion (end-of-line) (point)))) | 3790 (let ((bound (line-end-position))) |
3791 (cond ((re-search-forward "\C-?\\([^\C-a]+\\)\C-a" bound t) | 3791 (cond ((re-search-forward "\C-?\\([^\C-a]+\\)\C-a" bound t) |
3792 (buffer-substring-no-properties (match-beginning 1) | 3792 (buffer-substring-no-properties (match-beginning 1) |
3793 (match-end 1))) | 3793 (match-end 1))) |
3794 ((re-search-forward "\\<\\([^ \t]+\\)\\s-+new(" bound t) | 3794 ((re-search-forward "\\<\\([^ \t]+\\)\\s-+new(" bound t) |
3795 (buffer-substring-no-properties (match-beginning 1) | 3795 (buffer-substring-no-properties (match-beginning 1) |
3801 ))) | 3801 ))) |
3802 | 3802 |
3803 (defun speedbar-parse-tex-string () | 3803 (defun speedbar-parse-tex-string () |
3804 "Parse a Tex string. Only find data which is relevant." | 3804 "Parse a Tex string. Only find data which is relevant." |
3805 (save-excursion | 3805 (save-excursion |
3806 (let ((bound (save-excursion (end-of-line) (point)))) | 3806 (let ((bound (line-end-position))) |
3807 (cond ((re-search-forward "\\(\\(sub\\)*section\\|chapter\\|cite\\)\\s-*{[^\C-?}]*}?" bound t) | 3807 (cond ((re-search-forward "\\(\\(sub\\)*section\\|chapter\\|cite\\)\\s-*{[^\C-?}]*}?" bound t) |
3808 (buffer-substring-no-properties (match-beginning 0) | 3808 (buffer-substring-no-properties (match-beginning 0) |
3809 (match-end 0))) | 3809 (match-end 0))) |
3810 (t nil))))) | 3810 (t nil))))) |
3811 | 3811 |
3981 (save-excursion | 3981 (save-excursion |
3982 (beginning-of-line) | 3982 (beginning-of-line) |
3983 ;; If this fails, then it is a non-standard click, and as such, | 3983 ;; If this fails, then it is a non-standard click, and as such, |
3984 ;; perfectly allowed | 3984 ;; perfectly allowed |
3985 (if (re-search-forward "[]>?}] [^ ]" | 3985 (if (re-search-forward "[]>?}] [^ ]" |
3986 (save-excursion (end-of-line) (point)) | 3986 (line-end-position) |
3987 t) | 3987 t) |
3988 (let ((text (progn | 3988 (let ((text (progn |
3989 (forward-char -1) | 3989 (forward-char -1) |
3990 (buffer-substring (point) (save-excursion | 3990 (buffer-substring (point) (save-excursion |
3991 (end-of-line) | 3991 (end-of-line) |
4003 | 4003 |
4004 (defun speedbar-highlight-one-tag-line () | 4004 (defun speedbar-highlight-one-tag-line () |
4005 "Highlight the current line, unhighlighting a previously jumped to line." | 4005 "Highlight the current line, unhighlighting a previously jumped to line." |
4006 (speedbar-unhighlight-one-tag-line) | 4006 (speedbar-unhighlight-one-tag-line) |
4007 (setq speedbar-highlight-one-tag-line | 4007 (setq speedbar-highlight-one-tag-line |
4008 (speedbar-make-overlay (save-excursion (beginning-of-line) (point)) | 4008 (speedbar-make-overlay (line-beginning-position) |
4009 (save-excursion (end-of-line) | 4009 (save-excursion (end-of-line) |
4010 (forward-char 1) | 4010 (forward-char 1) |
4011 (point)))) | 4011 (point)))) |
4012 (speedbar-overlay-put speedbar-highlight-one-tag-line 'face | 4012 (speedbar-overlay-put speedbar-highlight-one-tag-line 'face |
4013 'speedbar-highlight-face) | 4013 'speedbar-highlight-face) |