aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/ffap-tests.el (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ; Add 2026 to copyright years.Sean Whitton2026-01-011-1/+1
|
* Add option 'ffap-prefer-remote-file' (bug#78925)Liu Hui2025-07-121-0/+22
| | | | | | | | | | | | | | | | | | This option only affects absolute filenames that are found by ffap-file-at-point in buffers with remote default directory. The handling of relative filenames in above buffers remains unchanged: ffap-file-at-point returns the relative filename, which can be converted to a remote absolute filename by subsequent callers (e.g. ffap) using expand-file-name. * lisp/ffap.el (ffap-prefer-remote-file): New user option. (ffap-file-exists-string): Add an optional argument to allow the check of existence of absolute filename on the remote host. (ffap-file-at-point): Always find remote files in remote context if the new option is non-nil. * test/lisp/ffap-tests.el (ffap-test-remote): Add a test. * etc/NEWS: Announce the change.
* Revert "Add option 'ffap-prefer-remote-file' (bug#78925)"Eli Zaretskii2025-07-121-22/+0
| | | | | | This reverts commit ae46edff68e8d5729207ed849df83ecb039e11bb. I mistakenly installed the wrong version of the patch for bug#78925.
* Add option 'ffap-prefer-remote-file' (bug#78925)Liu Hui2025-07-121-0/+22
| | | | | | | | | | | | | | | | | | This option only affects absolute filenames that are found by ffap-file-at-point in buffers with remote default directory. The handling of relative filenames in above buffers remains unchanged: ffap-file-at-point returns the relative filename, which can be converted to a remote absolute filename by subsequent callers (e.g. ffap) using expand-file-name. * lisp/ffap.el (ffap-prefer-remote-file): New user option. (ffap-file-exists-string): Add an optional argument to allow the check of existence of absolute filename on the remote host. (ffap-file-at-point): Always find remote files in remote context if the new option is non-nil. * test/lisp/ffap-tests.el (ffap-test-remote): Add a test. * etc/NEWS: Announce the change.
* Fix 'ffap-string-at-point' under 'ffap-file-name-with-spaces'Eli Zaretskii2025-06-081-8/+24
| | | | | | | | | * lisp/ffap.el (ffap-file-name-with-spaces): Doc fix. (ffap-string-at-point): Don't reject '~foo/' and 'd:/bar' file names when 'ffap-file-name-with-spaces' is non-nil. * test/lisp/ffap-tests.el (ffap-test-with-spaces): Add tests, and fix expected results to not strip Windows drive letters.
* Add a portable test for ffap parsing path-style directory listsEli Zaretskii2025-03-011-1/+27
| | | | | | | * test/lisp/ffap-tests.el (ffap-test-path-unix): Renamed from 'ffap-test-path'. (ffap-test-path-portable): New test, which should work on all systems.
* (internal--c-header-file-path): Move to ffap.elStefan Monnier2025-02-281-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | This function is used so rarely that it's really best not to preload it. * lisp/ffap.el (ffap-url-regexp): Precompute. (ffap-c-path): Use `ffap--c-path`. (ffap--gcc-is-clang-p, ffap--c-path): Move and rename from subr.el's * lisp/subr.el (internal--gcc-is-clang-p) (internal--c-header-file-path): Move to ffap.el and rename. * lisp/man.el (Man-header-file-path): Default to a new value that delegates to ffap. (Man-header-file-path): Obey that new value. * lisp/emacs-lisp/ert-x.el (ert-gcc-is-clang-p): Use `ffap--gcc-is-clang-p`. * test/lisp/ffap-tests.el (ffap-tests--c-path) (ffap-tests--c-path/gcc-mocked, ffap-tests--c-path/clang-mocked): Move and rename from `subr-tests.el`. * test/lisp/subr-tests.el (subr-tests-internal--c-header-file-path) (subr-tests-internal--c-header-file-path/gcc-mocked) (subr-tests-internal--c-header-file-path/clang-mocked): Move to `ffap-tests.el` and rename.
* Update copyright year to 2025Paul Eggert2025-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Convert ffap comments to testsStefan Kangas2022-07-281-0/+19
| | | | | * test/lisp/ffap-tests.el (ffap-file-remote-p, ffap-machine-p): New tests.
* New test ffap-replace-file-componentStefan Kangas2022-07-281-0/+5
| | | | * test/lisp/ffap-tests.el (ffap-replace-file-component): New test.
* Rename compare-window-configurations and update docLars Ingebrigtsen2022-05-201-1/+1
| | | | | | | | | | | | * doc/lispref/windows.texi (Window Configurations): Update name. * lisp/strokes.el (strokes-window-configuration-changed-p): * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Update callers and references. * lisp/subr.el (compare-window-configurations): Make into obsolete alias. * src/window.c (Fwindow_configuration_equal_p): Rename (bug#14964).
* Skip ffap test on some systemsLars Ingebrigtsen2022-01-141-0/+2
|
* Don't have ffap interpret ":/bin" as the current directoryLars Ingebrigtsen2022-01-141-0/+15
| | | | | * lisp/ffap.el (ffap-file-at-point): Don't interpret :/bin as the current directory (bug#52441).
* 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
| |
* | Make 'eval' use lexical scoping in most testsStefan Kangas2021-11-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/electric-tests.el (electric-pair-define-test-form) (define-electric-pair-test): * test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--uncompiled-functions): * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-test--symbol-macrolet): * test/lisp/emacs-lisp/let-alist-tests.el (let-alist-list-to-sexp): * test/lisp/emacs-lisp/lisp-tests.el (elisp-tests-with-temp-buffer, core-elisp-tests-3-backquote): * test/lisp/emacs-lisp/testcover-resources/testcases.el (testcover-testcase-nth-case): * test/lisp/ffap-tests.el (ffap-ido-mode): * test/lisp/files-tests.el (file-test--do-local-variables-test): * test/lisp/net/tramp-tests.el (tramp--test-utf8): * test/lisp/progmodes/elisp-mode-tests.el (find-defs-defgeneric-eval, find-defs-defun-eval) (find-defs-defvar-eval, find-defs-face-eval) (find-defs-feature-eval): Give 'eval' non-nil LEXICAL argument. * test/lisp/subr-tests.el (subr-tests--dolist--wrong-number-of-args): * test/src/eval-tests.el (eval-tests--if-dot-string) (eval-tests--mutating-cond) (eval-tests-19790-backquote-comma-dot-substitution): Test 'eval' using LEXICAL as both nil and non-nil. (eval-tests--let-with-circular-defs): Give explicit nil to 'eval'.
* | Prefer ert-with-temp-(directory|file)Stefan Kangas2021-11-071-15/+14
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/abbrev-tests.el (read-write-abbrev-file-test) (read-write-abbrev-file-test-with-props) (abbrev-edit-save-to-file-test): * test/lisp/auth-source-tests.el (auth-source-test-netrc-create-secret) (auth-source-delete): * test/lisp/autoinsert-tests.el (autoinsert-tests-auto-insert-file): * test/lisp/bookmark-tests.el (with-bookmark-test-save-load): * test/lisp/buff-menu-tests.el (buff-menu-24962): * test/lisp/calendar/icalendar-tests.el (icalendar-tests--do-test-export): * test/lisp/calendar/todo-mode-tests.el (with-todo-test): * test/lisp/dired-tests.el (dired-test-bug27243-01, dired-test-bug27243-02) (dired-test-bug27243-03, dired-test-bug27631) (dired-test-bug27968, dired-test-with-temp-dirs): * test/lisp/dired-x-tests.el (dired-test-bug25942): * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--with-temp-file): * test/lisp/emacs-lisp/check-declare-tests.el (check-declare-tests-scan) (check-declare-tests-verify-mismatch): * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-with-normal-env): * test/lisp/emacs-lisp/package-tests.el (with-package-test) (package-test-signed): * test/lisp/emacs-lisp/testcover-tests.el (testcover-tests-markup-region) (testcover-tests-run-test-case): * test/lisp/emulation/viper-tests.el (viper-test-undo-kmacro): * test/lisp/epg-tests.el (with-epg-tests): * test/lisp/eshell/em-hist-tests.el (eshell-write-readonly-history): * test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27631): * test/lisp/ffap-tests.el (ffap-tests-25243): * test/lisp/files-tests.el (files-tests-bug-18141) (files-tests-read-file-in-~, files-tests-make-directory) (files-tests-copy-directory, files-tests-executable-find) (files-tests-dont-rewrite-precious-files) (files-tests--save-some-buffers): * test/lisp/ls-lisp-tests.el (ls-lisp-test-bug27631): * test/lisp/mail/uudecode-tests.el (uudecode-tests-decode-region-internal) (uudecode-tests-decode-region-external): * test/lisp/net/browse-url-tests.el (browse-url-tests-delete-temp-file): * test/lisp/progmodes/elisp-mode-tests.el (xref--case-insensitive): * test/lisp/progmodes/etags-tests.el (etags-buffer-local-tags-table-list): * test/lisp/progmodes/flymake-tests.el (ruby-backend): * test/lisp/progmodes/python-tests.el (python-tests-with-temp-file): * test/lisp/progmodes/sql-tests.el (with-sql-test-connect-harness): * test/lisp/saveplace-tests.el (saveplace-test-save-place-to-alist/file) (saveplace-test-forget-unreadable-files) (saveplace-test-place-alist-to-file): * test/lisp/so-long-tests/spelling-tests.el: * test/lisp/textmodes/reftex-tests.el (reftex-locate-bibliography-files) (reftex-parse-from-file-test): * test/lisp/thumbs-tests.el (thumbs-tests-thumbsdir/create-if-missing): * test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-bug9726) (vc-bzr-test-bug9781, vc-bzr-test-faulty-bzr-autoloads): * test/lisp/vc/diff-mode-tests.el (diff-mode-test-ignore-trailing-dashes): * test/lisp/vc/ediff-ptch-tests.el (ediff-ptch-test-bug26084): * test/lisp/wdired-tests.el (wdired-test-bug32173-01) (wdired-test-bug32173-02, wdired-test-symlink-name) (wdired-test-unfinished-edit-01, wdired-test-bug34915) (wdired-test-bug39280): * test/src/buffer-tests.el (test-kill-buffer-auto-save-default): * test/src/filelock-tests.el (filelock-tests--fixture): * test/src/inotify-tests.el (inotify-file-watch-simple): * test/src/undo-tests.el (undo-test-file-modified): Prefer 'ert-with-temp-(directory|file)' to using 'make-temp-file' directly. In some cases, this is just cleanup, but in several cases this fixes bugs where an error would have lead to us not cleaning up.
* Improve ffap-ido-mode testdickmao2021-08-061-5/+9
| | | | | * test/lisp/ffap-tests.el (ffap-ido-mode): Actually test `ido-everywhere' at run time, not compile time (bug#49895).
* ffap ido accommodationdickmao2021-08-041-0/+15
| | | | | | | | | | Now that ffap-file-finder can be ido-find-file, the noninteractive portion of find-file-at-point cannot assume ffap-file-finder always takes an argument (ido-find-file does not). * lisp/ffap.el (find-file-at-point): Do not call ffap-file-finder. * test/lisp/ffap-tests.el (ffap-ido-mode): Test it.
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* `ffap-gopher-at-point' interminable without newlinesdickmao2020-10-191-0/+6
| | | | | | | * lisp/ffap.el (ffap-gopher-at-point): Stop when we get to the end of the buffer. * test/lisp/ffap-tests.el (ffap-test-no-newlines): Ensure termination for corner case (bug#44048).
* Add support for ffap guessing at file names containing spacesJari Aalto2020-08-151-0/+40
| | | | | | | | * lisp/ffap.el (ffap-file-name-with-spaces): New variable (bug#8439). (ffap-search-backward-file-end, ffap-search-forward-file-end) (ffap-dir-separator-near-point): New functions. (ffap-string-at-point): Use the variable and the new functions to guess at files containing strings.
* Fix sxhash-equal on bytecodes, markers, etc.Paul Eggert2020-01-071-1/+1
| | | | | | | | | | | | | | | | | | Problem reported by Pip Cet (Bug#38912#14). * doc/lispref/objects.texi (Equality Predicates): Document better when ‘equal’ looks inside objects. * doc/lispref/windows.texi (Window Configurations): Don’t say that ‘equal’ looks inside window configurations. * etc/NEWS: Mention the change. * src/fns.c (internal_equal): Do not look inside window configurations. (sxhash_obj): Hash markers, byte-code function objects, char-tables, and font objects consistently with Fequal. * src/window.c (compare_window_configurations): Now static. Remove last argument. Caller changed. * test/lisp/ffap-tests.el (ffap-other-window--bug-25352): Use compare-window-configurations, not ‘equal’. * test/src/fns-tests.el (test-sxhash-equal): New test.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Update a ffap testGlenn Morris2019-07-141-3/+1
| | | | | * test/lisp/ffap-tests.el (ffap-other-window--bug-25352): Update for incompatible ffap-other-window change.
* Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Prefer HTTPS to HTTP for gnu.orgPaul Eggert2017-09-131-4/+4
| | | | | | | | | | | | | | | This patch just changes code files; a followup companion patch (much larger) will affect the commentary. This part is separated out to make it easier to review. * .dir-locals.el (change-log-mode): * lisp/org/org-info.el (org-info-other-documents) (org-info-map-html-url): * lisp/org/ox-html.el (org-html-creator-string): * lisp/startup.el (fancy-startup-text, fancy-about-text) (fancy-splash-head): * test/lisp/ffap-tests.el (ffap-other-window--bug-25352): * test/lisp/thingatpt-tests.el (thing-at-point-test-data): Use HTTPS instead of HTTP.
* ffap: Don't switch window unless neededPhilipp Stephani2017-04-221-0/+13
| | | | | | | | | | When using ffap-other-window, don't change the window configuration unless a new buffer has actually been created (Bug#25352). * lisp/ffap.el (ffap-other-frame): Don't change the window configuration if no new buffer has been created. * test/lisp/ffap-tests.el (ffap-other-window--bug-25352): Add unit test.
* test/*.el: Avoid byte-compiler warningsJuanma Barranquero2017-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/abbrev-tests.el (abbrev-table-p-test): Remove unused 'let*'. * test/lisp/faces-tests.el (faces--test): New customization group. (faces--test1, faces--test2): Use it. * test/lisp/ffap-tests.el (ffap-tests-25243): Call 'mark-whole-buffer' interactively. * test/lisp/ibuffer-tests.el (ibuffer-filter-groups, ibuffer-filtering-alist) (ibuffer-filtering-qualifiers, ibuffer-save-with-custom) (ibuffer-saved-filter-groups, ibuffer-saved-filters): Defvar. (ibuffer-format-qualifier, ibuffer-unary-operand): Declare. * test/lisp/minibuffer-tests.el (completion-test1): Mark unused lexical arguments. * test/lisp/simple-tests.el (simple-test--dummy-buffer): Wrap result in 'with-no-warnings' to avoid them when the macro is invoked for effect. * test/lisp/emacs-lisp/cl-seq-tests.el (cl-seq-count-test): Mark unused lexical arguments. * test/lisp/emacs-lisp/let-alist-tests.el (let-alist-surface-test): Mark unused lexical arguments. (let-alist-cons): Remove unused let binding. * test/lisp/net/dbus-tests.el (dbus-debug): Defvar. (dbus-get-unique-name): Declare. * test/lisp/progmodes/python-tests.el (python-bob-infloop-avoid): Call 'font-lock-fontify-buffer' interactively. * test/lisp/textmodes/tildify-tests.el (tildify-space-undo-test--test): Mark unused lexical argument.
* Improve ffap-gopher-at-point handling of long linesNoam Postavsky2017-01-151-0/+17
| | | | | | | | | | * lisp/ffap.el (ffap-gopher-regexp): Only match the KEY part. Note setting to nil is now supported. (ffap--gopher-var-on-line): New function. (ffap-gopher-at-point): Use it instead of the old ffap-gopher-regexp which could overflow the regexp stack on long lines (Bug#25391). Use `let-alist' instead of calling `set' on local variables. * test/lisp/ffap-tests.el (ffap-gopher-at-point): New test.
* Update copyright year to 2017 in masterPaul Eggert2017-01-011-1/+1
| | | | | | Run admin/update-copyright in the master branch. This fixes files that were not already fixed in the emacs-25 branch before it was merged here.
* ffap-string-at-point: Limit max length of active regionTino Calancha2016-12-301-0/+54
Prevents that 'ffap-guesser' waste time checking large strings which are likely not valid candidates (Bug#25243). * lisp/ffap.el (ffap-max-region-length): New variable. (ffap-string-at-point): Use it. * test/lisp/ffap-tests.el: New test suite. (ffap-tests-25243): Add test for this bug.