Mercurial > emacs
comparison lisp/dired-aux.el @ 111445:56b71cddc9c5
Replace still more end-of-line etc with line-end-position, etc.
* lisp/gnus/nnbabyl.el (nnbabyl-request-move-article, nnbabyl-delete-mail)
(nnbabyl-check-mbox): Use point-at-bol.
* lisp/cedet/semantic/lex.el (semantic-lex-ignore-comments, semantic-flex):
* lisp/cedet/semantic/grammar.el (semantic-grammar-epilogue):
* lisp/cedet/ede/speedbar.el (ede-find-nearest-file-line):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/ede/autoconf-edit.el (autoconf-delete-parameter):
Use point-at-bol and point-at-eol.
* lisp/vc/emerge.el (emerge-line-number-in-buf):
* lisp/textmodes/ispell.el (ispell-region):
* lisp/textmodes/fill.el (current-fill-column):
* lisp/progmodes/xscheme.el (xscheme-send-current-line):
* lisp/progmodes/vhdl-mode.el (vhdl-current-line, vhdl-line-copy):
* lisp/progmodes/tcl.el (tcl-hairy-scan-for-comment):
* lisp/progmodes/sh-script.el (sh-handle-prev-do):
* lisp/progmodes/meta-mode.el (meta-indent-line):
* lisp/progmodes/idlwave.el (idlwave-goto-comment, idlwave-fill-paragraph)
(idlwave-in-quote):
* lisp/progmodes/idlw-shell.el (idlwave-shell-current-frame)
(idlwave-shell-update-bp-overlays, idlwave-shell-sources-filter):
* lisp/progmodes/fortran.el (fortran-looking-at-if-then):
* lisp/progmodes/etags.el (find-tag-in-order, etags-snarf-tag):
* lisp/progmodes/cperl-mode.el (cperl-sniff-for-indent)
(cperl-find-pods-heres):
* lisp/progmodes/ada-mode.el (ada-get-current-indent, ada-narrow-to-defun):
* lisp/net/quickurl.el (quickurl-list-insert):
* lisp/net/ldap.el (ldap-search-internal):
* lisp/net/eudc.el (eudc-expand-inline):
* lisp/mail/sendmail.el (sendmail-send-it):
* lisp/mail/mspools.el (mspools-visit-spool, mspools-get-spool-name):
* lisp/emulation/viper-cmd.el (viper-paren-match, viper-backward-indent)
(viper-brac-function):
* lisp/calc/calc-yank.el (calc-do-grab-region):
* lisp/calc/calc-keypd.el (calc-keypad-press):
* lisp/term.el (term-move-columns, term-insert-spaces):
* lisp/speedbar.el (speedbar-highlight-one-tag-line):
* lisp/simple.el (current-word):
* lisp/mouse-drag.el (mouse-drag-should-do-col-scrolling):
* lisp/info.el (Info-find-node-in-buffer-1, Info-follow-reference)
(Info-scroll-down):
* lisp/hippie-exp.el (he-line-beg):
* lisp/epa.el (epa--marked-keys):
* lisp/dired-aux.el (dired-kill-line, dired-do-kill-lines)
(dired-update-file-line, dired-add-entry, dired-remove-entry)
(dired-relist-entry):
* lisp/buff-menu.el (Buffer-menu-buffer):
* lisp/array.el (current-line):
* lisp/allout.el (allout-resolve-xref)
(allout-latex-verbatim-quote-curr-line):
Replace yet more uses of end-of-line etc with line-end-position.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Mon, 08 Nov 2010 21:33:07 -0800 |
parents | 280c8ae2476d |
children | c00190a8c8ef |
comparison
equal
deleted
inserted
replaced
111444:60f509c70b61 | 111445:56b71cddc9c5 |
---|---|
1 ;;; dired-aux.el --- less commonly used parts of dired | 1 ;;; dired-aux.el --- less commonly used parts of dired |
2 | 2 |
3 ;; Copyright (C) 1985, 1986, 1992, 1994, 1998, 2000, 2001, 2002, 2003, | 3 ;; Copyright (C) 1985, 1986, 1992, 1994, 1998, 2000, 2001, 2002, 2003, |
4 ;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | 4 ;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
5 ;; Free Software Foundation, Inc. | |
5 | 6 |
6 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>. | 7 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>. |
7 ;; Maintainer: FSF | 8 ;; Maintainer: FSF |
8 ;; Keywords: files | 9 ;; Keywords: files |
9 ;; Package: emacs | 10 ;; Package: emacs |
698 (if (not file) | 699 (if (not file) |
699 (error "Can only kill file lines") | 700 (error "Can only kill file lines") |
700 (save-excursion (and file | 701 (save-excursion (and file |
701 (dired-goto-subdir file) | 702 (dired-goto-subdir file) |
702 (dired-kill-subdir))) | 703 (dired-kill-subdir))) |
703 (delete-region (progn (beginning-of-line) (point)) | 704 (delete-region (line-beginning-position) |
704 (progn (forward-line 1) (point))) | 705 (progn (forward-line 1) (point))) |
705 (if (> arg 0) | 706 (if (> arg 0) |
706 (setq arg (1- arg)) | 707 (setq arg (1- arg)) |
707 (setq arg (1+ arg)) | 708 (setq arg (1+ arg)) |
708 (forward-line -1)))) | 709 (forward-line -1)))) |
732 (count 0) | 733 (count 0) |
733 (regexp (dired-marker-regexp))) | 734 (regexp (dired-marker-regexp))) |
734 (while (and (not (eobp)) | 735 (while (and (not (eobp)) |
735 (re-search-forward regexp nil t)) | 736 (re-search-forward regexp nil t)) |
736 (setq count (1+ count)) | 737 (setq count (1+ count)) |
737 (delete-region (progn (beginning-of-line) (point)) | 738 (delete-region (line-beginning-position) |
738 (progn (forward-line 1) (point)))) | 739 (progn (forward-line 1) (point)))) |
739 (or (equal "" fmt) | 740 (or (equal "" fmt) |
740 (message (or fmt "Killed %d line%s.") count (dired-plural-s count))) | 741 (message (or fmt "Killed %d line%s.") count (dired-plural-s count))) |
741 count)))) | 742 count)))) |
742 | 743 |
1035 ;; Delete the current line, and insert an entry for FILE. | 1036 ;; Delete the current line, and insert an entry for FILE. |
1036 ;; If FILE is nil, then just delete the current line. | 1037 ;; If FILE is nil, then just delete the current line. |
1037 ;; Keeps any marks that may be present in column one (doing this | 1038 ;; Keeps any marks that may be present in column one (doing this |
1038 ;; here is faster than with dired-add-entry's optional arg). | 1039 ;; here is faster than with dired-add-entry's optional arg). |
1039 ;; Does not update other dired buffers. Use dired-relist-entry for that. | 1040 ;; Does not update other dired buffers. Use dired-relist-entry for that. |
1040 (beginning-of-line) | 1041 (let ((char (following-char)) |
1041 (let ((char (following-char)) (opoint (point)) | 1042 (opoint (line-beginning-position)) |
1042 (buffer-read-only)) | 1043 (buffer-read-only)) |
1043 (delete-region (point) (progn (forward-line 1) (point))) | 1044 (delete-region opoint (progn (forward-line 1) (point))) |
1044 (if file | 1045 (if file |
1045 (progn | 1046 (progn |
1046 (dired-add-entry file nil t) | 1047 (dired-add-entry file nil t) |
1047 ;; Replace space by old marker without moving point. | 1048 ;; Replace space by old marker without moving point. |
1048 ;; Faster than goto+insdel inside a save-excursion? | 1049 ;; Faster than goto+insdel inside a save-excursion? |
1131 (forward-line -1) | 1132 (forward-line -1) |
1132 (if dired-after-readin-hook ;; the subdir-alist is not affected... | 1133 (if dired-after-readin-hook ;; the subdir-alist is not affected... |
1133 (save-excursion ;; ...so we can run it right now: | 1134 (save-excursion ;; ...so we can run it right now: |
1134 (save-restriction | 1135 (save-restriction |
1135 (beginning-of-line) | 1136 (beginning-of-line) |
1136 (narrow-to-region (point) (save-excursion | 1137 (narrow-to-region (point) (line-beginning-position 2)) |
1137 (forward-line 1) (point))) | |
1138 (run-hooks 'dired-after-readin-hook)))) | 1138 (run-hooks 'dired-after-readin-hook)))) |
1139 (dired-move-to-filename)) | 1139 (dired-move-to-filename)) |
1140 ;; return nil if all went well | 1140 ;; return nil if all went well |
1141 nil)) | 1141 nil)) |
1142 (if reason ; don't move away on failure | 1142 (if reason ; don't move away on failure |
1165 (defun dired-remove-entry (file) | 1165 (defun dired-remove-entry (file) |
1166 (save-excursion | 1166 (save-excursion |
1167 (and (dired-goto-file file) | 1167 (and (dired-goto-file file) |
1168 (let (buffer-read-only) | 1168 (let (buffer-read-only) |
1169 (delete-region (progn (beginning-of-line) (point)) | 1169 (delete-region (progn (beginning-of-line) (point)) |
1170 (save-excursion (forward-line 1) (point))))))) | 1170 (line-beginning-position 2)))))) |
1171 | 1171 |
1172 ;;;###autoload | 1172 ;;;###autoload |
1173 (defun dired-relist-file (file) | 1173 (defun dired-relist-file (file) |
1174 "Create or update the line for FILE in all Dired buffers it would belong in." | 1174 "Create or update the line for FILE in all Dired buffers it would belong in." |
1175 (dired-fun-in-all-buffers (file-name-directory file) | 1175 (dired-fun-in-all-buffers (file-name-directory file) |
1186 (save-excursion | 1186 (save-excursion |
1187 (and (dired-goto-file file) | 1187 (and (dired-goto-file file) |
1188 (delete-region (progn (beginning-of-line) | 1188 (delete-region (progn (beginning-of-line) |
1189 (setq marker (following-char)) | 1189 (setq marker (following-char)) |
1190 (point)) | 1190 (point)) |
1191 (save-excursion (forward-line 1) (point)))) | 1191 (line-beginning-position 2))) |
1192 (setq file (directory-file-name file)) | 1192 (setq file (directory-file-name file)) |
1193 (dired-add-entry file (if (eq ?\040 marker) nil marker))))) | 1193 (dired-add-entry file (if (eq ?\040 marker) nil marker))))) |
1194 | 1194 |
1195 ;;; Copy, move/rename, making hard and symbolic links | 1195 ;;; Copy, move/rename, making hard and symbolic links |
1196 | 1196 |
2480 ;; Local Variables: | 2480 ;; Local Variables: |
2481 ;; byte-compile-dynamic: t | 2481 ;; byte-compile-dynamic: t |
2482 ;; generated-autoload-file: "dired.el" | 2482 ;; generated-autoload-file: "dired.el" |
2483 ;; End: | 2483 ;; End: |
2484 | 2484 |
2485 ;; arch-tag: 4b508de9-a153-423d-8d3f-a1bbd86f4f60 | |
2486 ;;; dired-aux.el ends here | 2485 ;;; dired-aux.el ends here |