summaryrefslogtreecommitdiff
path: root/lisp/wdired.el
Commit message (Collapse)AuthorAgeFilesLines
* Add search function to search within filenames in Dired and WDired (bug#14013)Juri Linkov2022-03-281-10/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/dired-aux.el (dired-isearch-filenames-mode): Use dired-isearch-search-filenames on isearch-search-fun-function instead of dired-isearch-filter-filenames on isearch-filter-predicate. (dired-isearch-filter-filenames): Remove function. (dired-isearch-search-filenames): Add function. * lisp/isearch.el (isearch-message-prefix): Add isearch-search-fun-function to the list of supported advice-functions along with isearch-filter-predicate. * lisp/replace.el (replace-search): Add comment. * lisp/wdired.el (wdired-search-replace-filenames): New defcustom. (wdired-isearch-filter-read-only): Remove function. (wdired-change-to-wdired-mode, wdired-change-to-dired-mode): Add and remove dired-isearch-search-filenames on isearch-search-fun-function instead of wdired-isearch-filter-read-only on isearch-filter-predicate. Also set/unset replace-search-function and replace-re-search-function. Remove and restore isearch-mode-hook with dired-isearch-filenames-setup. The problem is that dired-isearch-filenames-setup adds dired-isearch-filenames-end to isearch-mode-end-hook that removes dired-isearch-search-filenames added to isearch-search-fun-function in wdired-change-to-wdired-mode. Then replace-highlight can't use dired-isearch-search-filenames.
* Allow using dired-hide-details-mode in wdired buffersLars Ingebrigtsen2022-01-281-0/+1
| | | | | | | * lisp/dired.el (dired-hide-details-mode): Also work in wdired-mode buffers (bug#45127). * lisp/wdired.el (wdired-mode-map): Add a key binding.
* Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| |
* | Use defvar-keymap in wdired.elStefan Kangas2021-12-201-35/+31
|/ | | | | * lisp/wdired.el (wdired-mode-map, wdired-perm-mode-map): Use defvar-keymap.
* ; More minor stylistic fixes found by checkdocStefan Kangas2021-09-221-2/+2
|
* ; Minor stylistic fixes found by checkdocStefan Kangas2021-09-161-1/+1
|
* Make wdired work better in narrowed-to buffersLars Ingebrigtsen2021-07-191-59/+63
| | | | | | * lisp/wdired.el (wdired--before-change-fn): (wdired--restore-properties): Widen before doing anything so that we get all the changed bits (bug#49124).
* * lisp/wdired.el (wdired-normalize-filename): Sync withAndreas Schwab2021-05-291-7/+26
| | | | dired-get-filename. (Bug#48659)
* * lisp/wdired.el (wdired--before-change-fn): Wrap body in save-match-data.Juri Linkov2021-04-231-20/+21
| | | | Suggested by Michael Heerdegen <michael_heerdegen@web.de> (bug#14013)
* * lisp/wdired.el (wdired--self-insert): Put symbol property delete-selection.Juri Linkov2021-04-201-0/+2
|
* * lisp/wdired.el (wdired--self-insert): Fix thinkoStefan Monnier2021-03-271-4/+3
|
* * lisp/wdired.el: Fix minor regressions and simplify a bitStefan Monnier2021-03-271-114/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use `wdired--current-column` more consistently to avoid mayhem when it doesn't return the same result as `current-column`. (wdired-get-filename): Fix the unprocessed case. (wdired-finish-edit): Don't force processing all the lines. (wdired--col-perm): Remove, redundant with `wdired--perm-beg`. (wdired-change-to-wdired-mode): Don't error in empty directory. (wdired--set-permission-bounds): Set `wdired--perm-beg` when we can't find permissions. Move `wdired--perm-beg` 1 char further (like `wdired--col-perm`). Use `wdired--current-column`. (wdired--point-at-perms-p): Fix when `wdired--perm-beg` is nil. (wdired--self-insert): Lookup the keymap to know command to call. (wdired--before-change-fn): Just use `point` instead of `beg`. Use `with-silent-modifications` here rather than in each of the `wdired--preprocess-*` functions. (wdired--preprocess-files): Presume we're at BOL and within `with-silent-modifications`. Fix application of `read-only`. (wdired-abort-changes): Don't use `with-silent-modifications` since we're really modifying the buffer. (wdired--preprocess-symlinks): Presume we're at BOL and within `with-silent-modifications`. (wdired--preprocess-perms): Presume we're at BOL and within `with-silent-modifications`. (wdired-set-bit): Add `char` argument. Use `wdired--current-column`. Copy previous text properties rather than duplicating the code of `wdired--preprocess-perms`. (wdired-toggle-bit): Delegate to `wdired-set-bit`.
* * lisp/wdired.el: Apply text properties lazilyArthur Miller2021-03-271-92/+128
| | | | | | | | | | | | | | | | | | | | | | | Entering wdired was taking time proportional to the size of the directory, making it inconvenient to quickly enter wdired just to rename one or two files in a large directory. (wdired-mode-map): Rebind `self-insert-command`. (wdired--perm-beg, wdired--perm-end): New vars. (wdired--col-perm, wdired--old-content, wdired--old-point) (wdired--old-marks): Rename vars, using "--" rather than "-". All users updated. (wdired--before-change-fn): New function. (wdired-change-to-wdired-mode): Use it `before-change-functions` instead of eagerly putting the various text properties here. (wdired--set-permission-bounds, wdired--current-column) (wdired--point-at-perms-p, wdired--line-preprocessed-p): New auxiliary functions. (wdired--self-insert): New command. (wdired--preprocess-files, wdired--preprocess-symlinks) (wdired--preprocess-perms): Add "--" to the name. Make it operate only on the current line. Use `with-silent-modifications`. (wdired-abort-changes): Use `with-silent-modifications`.
* * lisp/wdired.el: Fix typo in last change.Stefan Monnier2021-03-231-2/+2
| | | | | | | Reported by Michael Heerdegen <michael_heerdegen@web.de>. (wdired-change-to-wdired-mode, wdired-change-to-dired-mode): The `(local FOO)` form takes an expression, so the var needs to be quoted.
* * lisp/wdired.el: Use lexical-bindingStefan Monnier2021-03-191-50/+42
| | | | | | | | | Remove redundant `:group` args. (wdired-change-to-wdired-mode): Use `add-function` to modify `revert-buffer-function`. (wdired-change-to-dired-mode): Adjust accordingly. (wdired-do-renames): Make sure to bind `dired-backup-overwrite` dynamically.
* Convert some more menus to easy-menu-defineStefan Kangas2021-02-231-14/+9
| | | | | | | | | | | * lisp/tar-mode.el (tar-mode-map): * lisp/textmodes/sgml-mode.el (sgml-mode-map, html-mode-map): * lisp/wdired.el (wdired-mode-map): Move menus from here... * lisp/tar-mode.el (tar-mode-immediate-menu, tar-mode-mark-menu) * lisp/textmodes/sgml-mode.el (sgml-mode-menu, html-mode-menu): * lisp/wdired.el (wdired-mode-menu): ...to here, and convert to easy-menu-define.
* Use `undefined' instead of `ignore' in wdiredLars Ingebrigtsen2021-02-211-3/+3
| | | | | * lisp/wdired.el (wdired-mode-map): Use `undefined' here instead of `ignore' to give the user more feedback.
* * lisp/wdired.el: Minor doc fixes.Stefan Kangas2021-01-281-10/+10
|
* Avoid recommending GoogleStefan Kangas2021-01-281-2/+2
| | | | | | | | | | | * doc/misc/org.texi (Link Abbreviations): * lisp/net/webjump.el (webjump-sample-sites): * lisp/org/ol.el (org-link-shell-confirm-function) (org-link-elisp-confirm-function): * lisp/org/org.el (org-highlight-links): * lisp/wdired.el: Avoid recommending Google. squash! Avoid recommending Google
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Fix wdired-get-filename when ls -F marks symlinksDaniel Martín2020-12-221-1/+4
| | | | | | | | * lisp/wdired.el (wdired-get-filename): In some systems like BSD or macOS, "ls -F" marks symlinks with a trailing "@". Add logic accounting for this so that wdired-get-filename returns the correct filename. This change also fixes test "wdired-test-bug34915" on macOS and BSD systems (bug#34915).
* Prefer setq-local in dired extensionsStefan Kangas2020-12-091-8/+8
| | | | | | | | * lisp/dired-aux.el (dired-diff, dired-compare-directories) (dired-do-create-files, dired-isearch-filenames): * lisp/dired-x.el (dired-virtual, dired-vm): * lisp/wdired.el (wdired-change-to-wdired-mode) (wdired-change-to-dired-mode, wdired-preprocess-perms):
* Use null-device where appropriateMichael Albinus2020-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * lisp/filesets.el (filesets-select-command): * lisp/shell.el (shell-mode): * lisp/term.el (term-exec-1): * lisp/wdired.el (wdired-do-symlink-changes): * lisp/cedet/ede/pmake.el (ede-proj-makefile-create): * lisp/eshell/esh-io.el (eshell-set-output-handle): * lisp/gnus/gnus-fun.el (gnus-grab-cam-x-face): * lisp/gnus/mml2015.el (mml2015-epg-key-image): * lisp/gnus/smime.el (smime-noverify-region): * lisp/org/ob-picolisp.el (org-babel-execute:picolisp): * lisp/org/ob-screen.el (org-babel-prep-session:screen) (org-babel-prep-session:screen): * lisp/play/fortune.el (fortune-quiet-strfile-options): * lisp/progmodes/cperl-mode.el (cperl-pod2man-build-command): * lisp/progmodes/sh-script.el (sh-tmp-file): * lisp/vc/diff-mode.el (diff-add-log-current-defuns) (diff--font-lock-prettify): * lisp/vc/ediff-mult.el (ediff-patch-file-form-meta): * lisp/vc/ediff-ptch.el (ediff-map-patch-buffer) (ediff-fixup-patch-map, ediff-dispatch-file-patching-job): * lisp/vc/vc.el (vc-diff-internal): Use null-device or (null-device), respectively. (Bug#3736)
* wdired: fix error handling of set-file-modesAndreas Schwab2020-10-311-23/+21
| | | | | | | * lisp/wdired.el (wdired-perms-to-number): Return decimal number. (wdired-do-perm-changes): Handle error from set-file-modes. (wdired-finish-edit): Remove `rename' from error message. (Bug#44343)
* Allow killing files with C-k in wdired if -F is usedStephen Berman2020-10-111-32/+72
| | | | | | | | | | * lisp/wdired.el (wdired-change-to-wdired-mode): Add hook to restore properties. (wdired-change-to-wdired-mode): Adjust check for symlinks. (wdired-preprocess-files): Fix parsing when using the -F flag. (wdired-get-filename): Fix parsing of symlinks when using the -F flag. (wdired--restore-properties): Renamed, and restore more properties (bug#18475).
* Fix wdired-do-perm-changes when over TrampTino Calancha2020-10-011-3/+3
| | | | | | * lisp/wdired.el (wdired-do-perm-changes) Use set-file-modes instead of external program (bug#39284). This fixes the problem of passing the wrong argument to the external chmod.
* Fix bug in wdired-get-filenameTino Calancha2020-10-011-1/+1
| | | | | | * lisp/wdired.el (wdired-get-filename): Acknowledge the first argument (bug#39280). * test/lisp/wdired-tests.el (wdired-test-bug39280): Add test.
* wdired-do-renames: Speed up for long Emacs sessionsTino Calancha2020-09-041-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | `dired-rename-file' calls unconditionally `dired-rename-subdir'. The second function performs performs a loop on all the Emacs buffers; this step is only needed if FILE is a directory (bug#32899). In a long lived Emacs session, this can make a difference when renaming a bunch of files with `wdired'. For instance, in my 40 days old Emacs session, with ~ 700 buffers, this patch increases the speed to rename 2000 files a factor ~ 15. * lisp/dired-aux.el (dired-rename-file): Call `dired-rename-subdir' iif FILE is a directory. Add docstring. (dired-rename-subdir, dired-remove-entry) (dired-remove-file): Add docstring. (dired-remove-entry): Move definition into `dired.el'. * lisp/wdired.el (wdired-do-renames): Use a progress-reporter. * lisp/dired.el (dired-delete-entry): Use `dired-remove-entry'. Add docstring. (dired-buffers-for-dir, dired-fun-in-all-buffers): Change comment into docstring. (dired-fun-in-all-buffers): Prefer `when' and `push' here.
* Mark the end of file names correctly on Macos in wdiredLars Ingebrigtsen2020-08-041-4/+11
| | | | | * lisp/wdired.el (wdired--restore-dired-filename-prop): Fix problem with finding the end of the name on Macos.
* Add "Old-" prefix to "Version" header in some casesStefan Kangas2020-03-211-1/+1
| | | | | | | | | | | | | | | | | These version numbers are historical accidents and not relevant today. Ref: https://lists.gnu.org/r/emacs-devel/2020-03/msg00080.html * lisp/calendar/icalendar.el: * lisp/emacs-lisp/checkdoc.el: * lisp/hippie-exp.el: * lisp/linum.el: * lisp/master.el: * lisp/progmodes/cwarn.el: * lisp/repeat.el: * lisp/ruler-mode.el: * lisp/textmodes/remember.el: * lisp/wdired.el: * lisp/woman.el: Change "Version" header to "Old-Version".
* * lisp/wdired.el (wdired-next-line, wdired-previous-line): Preserve columnStefan Monnier2020-02-181-0/+2
|
* * lisp/wdired.el: Clean out isearch-filter-predicate (bug#37496)Juri Linkov2020-01-281-0/+2
| | | | | | * lisp/wdired.el (wdired-change-to-dired-mode): Use remove-function to remove wdired-isearch-filter-read-only (whose value was added in wdired-change-to-wdired-mode) from local value of isearch-filter-predicate.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Prevent infinite loop on entering wdired-modeStephen Berman2019-07-161-2/+1
| | | | | | | * lisp/wdired.el (wdired-preprocess-symlinks): Remove unneeded use of beginning-of-line, which also triggers an infinite loop in a find-dired buffer that doesn't end with a newline (see discussion in bug#35609).
* Allow using wdired in all dired-derived modesLars Ingebrigtsen2019-07-131-1/+1
| | | | | * lisp/wdired.el (wdired-change-to-wdired-mode): Allow using in dired derived modes (bug#32392). Suggested by James Nguyen.
* * lisp/emacs-lisp/bytecomp.el (byte-compile-dynamic): Mark obsoleteStefan Monnier2019-06-211-5/+0
| | | | | | | | | | | | See bug#11649 for an example problem, and emacs-devel discussion «Prickliness of the "invalid byte code" stuff». * lisp/wid-edit.el, lisp/wdired.el, lisp/vc/pcvs-util.el: * lisp/progmodes/executable.el, lisp/mail/sendmail.el: * lisp/emacs-lisp/cl-seq.el, lisp/emacs-lisp/cl-macs.el: * lisp/emacs-lisp/cl-lib.el, lisp/emacs-lisp/cl-extra.el: * lisp/dired-x.el, lisp/dired-aux.el, lisp/calendar/calendar.el: Don't use byte-compile-dynamic any more.
* Make wdired-mode ignore ls file indicatorsStephen Berman2019-04-251-8/+17
| | | | | | | | * lisp/wdired.el (wdired--restore-dired-filename-prop): When dired-listing-switches includes "F" or "classify", don't treat appended indicator characters as part of the file name (bug#34915). * test/lisp/wdired-tests.el (wdired-test-bug34915): New test.
* Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
|\ | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
| * Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | | | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
| * Fix use of non-nil wdired-use-interactive-renameStephen Berman2018-07-281-9/+29
| | | | | | | | | | | | | | | | | | | | This is a fairly minimal fix for the release branch; a more comprehensive fix is on master, so do not merge this to master. * lisp/wdired.el (wdired-search-and-rename): Remove dired-filename text property in order to find new filename when it only partially replaces old filename (bug#32173). If user quits before renaming succeeds, restore the dired-filename text property.
* | Fix wdired handling of symlinks when restoring filename propertyStephen Berman2018-09-131-9/+16
| | | | | | | | | | | | | | * lisp/wdired.el (wdired--restore-dired-filename-prop): Use dired-permission-flags-regexp instead of dired-filename to test whether the file is a symlink, since calling file-symlink-p on the latter may fail in wdired-mode (bug#32673).
* | Handle symlinks in wdired.el when restoring filename propertyStephen Berman2018-07-291-1/+4
| | | | | | | | | | | | | | * lisp/wdired.el (wdired--restore-dired-filename-prop): If the file name is a symbolic link, only propertize the link name. This prevents wdired-create-parentdirs from turning the link into a directory.
* | Fix bugs in wdired.el involving dired-filename propertyStephen Berman2018-07-291-10/+38
|/ | | | | | | | | | | | | | | | | | | | | After every change in wdired-mode, put the dired-filename text property on the file name. This ensures that changing some but not all characters in the name succeeds with non-nil wdired-use-interactive-rename (bug#32173) and it also ensures that changed names can be found (e.g. by dired-isearch-filenames) while still in wdired-mode. * lisp/wdired.el (wdired--restore-dired-filename-prop): New function. (wdired-change-to-wdired-mode): Add it to after-change-functions. (wdired-change-to-dired-mode): Remove it from after-change-functions. (wdired-finish-edit): Move invocation of wdired-change-to-dired-mode below invocation of wdired-do-renames, so that the latter runs wdired--restore-dired-filename-prop, but above the invocation of revert-buffer to avoid using wdired-revert, which changes back to wdired-mode. (wdired-search-and-rename): Wrap renaming in unwind-protect and if user types C-g when prompted to change the file name, make sure we return to dired-mode.
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-1/+1
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Merge from origin/emacs-25Paul Eggert2017-01-011-1/+1
|\ | | | | | | | | 2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
| * Update copyright year to 2017Paul Eggert2016-12-311-1/+1
| | | | | | | | Run admin/update-copyright.
* | Update parameter :version to 26.1 in several defcustomTino Calancha2016-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following defcustom where added or modified for 25.2 release. In fact all these changes belong to 26.1 release. * lisp/battery.el (battery-linux-sysfs-regexp) * lisp/comint.el (comint-password-prompt-regexp) * lisp/dired.el (dired-always-read-filesystem) * lisp/image.el (image-scaling-factor) * lisp/ibuf-ext.el (ibuffer-never-search-content-name) (ibuffer-never-search-content-mode) * lisp/mouse.el (mouse-select-region-move-to-beginning) * lisp/net/net-utils.el (iwconfig-program, iwconfig-program-options) (netstat-program, route-program, route-program-options) * lisp/net/sieve-manage.el (sieve-manage-default-stream) * lisp/progmodes/grep.el (grep-save-buffers) * lisp/vc/add-log.el (change-log-directory-files) * lisp/url/url-vars.el (url-user-agent) * lisp/vc/vc-hg.el (vc-hg-symbolic-revision-styles) (vc-hg-use-file-version-for-mode-line-version) (vc-hg-parse-hg-data-structures) * lisp/wdired.el (wdired-create-parent-directories) * lisp/faces.el (homoglyph, nobreak-hyphen, read-multiple-choice-face) * lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol) (gnus-button-url-regexp) * lisp/window.el (switch-to-buffer-preserve-window-point) * lisp/ibuffer.el (ibuffer-formats, ibuffer-locked-char) (ibuffer-locked-buffer) * lisp/textmodes/flyspell.el (flyspell-sort-corrections-function) * lisp/emacs-lisp/edebug.el (edebug-sit-on-break) * lisp/gnus/message.el (message-user-fqdn) * lisp/simple.el (shell-command-dont-erase-buffer) (extended-command-suggest-shorter) * lisp/net/shr.el (shr-use-fonts) * lisp/files.el (mounted-file-systems, kill-emacs-query-functions)
* | * lisp/wdired.el (wdired-next-line, wdired-previous-line): Add "^"Juri Linkov2016-06-061-3/+3
| | | | | | | | to interactive spec to handle shift-selection. (Bug#23642)