1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00

Merge from savannah/emacs-30

1ee8579eb7 Fix bug#72255
05629d3af0 Delete redundant "a.k.a." in use-package.texi
c7609464f7 Document (use-package 'emacs) declarations
de9f9add13 Improve 'emacs-news-view-mode' menus and bindings
7588e1f8a9 ; * src/xdisp.c (Fformat_mode_line): Doc fix.
2074e94c3b Fix disappearing bar cursor on Hebrew text (bug#72230)
1aaadc8aec Fix DocView with DVI files
c1382257aa ; Fix typo in use-package.texi
caf7426f0c FIx spurious fontification of variable in Java Mode
9b426e15ab Correctly typeset nil and t in texinfo
f050b9c503 Fix Tramp IPv6 handling in tests
46b192c04b Update to Org 9.7.8-5-gfdf0e0
87f41b937b Fix Ftreesit_parser_create
This commit is contained in:
Po Lu 2024-07-24 11:41:58 +08:00
commit db40b65825
20 changed files with 205 additions and 137 deletions

View File

@ -693,9 +693,9 @@ an Org file.
@item :make
A string or list of strings providing the target or targets defined in
the repository Makefile which should run before building the Info
file. Only takes effect when @code{package-vc-allow-build-commands}
is non-nil.
the repository Makefile which should run before building the Info file.
Only takes effect when @code{package-vc-allow-build-commands} is
non-@code{nil}.
@item :shell-command
A string providing the shell command to run before building the Info

View File

@ -6179,7 +6179,7 @@ or @code{:flip} is changed.
If @code{:original-map} is not specified when creating an image with
@code{create-image}, it will be computed based on the supplied
@code{:map}, as well as any of @code{:scale}, @code{:rotation}, or
@code{:flip} which are non-nil.
@code{:flip} which are non-@code{nil}.
Conversely, if @code{:original-map} is specified but @code{:map} is not,
@code{:map} will be computed based on @code{:original-map},

View File

@ -3312,12 +3312,11 @@ only addressee.
@vindex pop-up-frames@r{, a buffer display action alist entry}
@item pop-up-frames
The value controls whether @code{display-buffer} may display buffers
by making new frames. It has the same meaning as the
@code{pop-up-frames} variable and takes precedence over it when present.
Its main intended purpose is to override a non-nil value of the
variable for particular buffers which the user prefers to keep
in the selected frame.
The value controls whether @code{display-buffer} may display buffers by
making new frames. It has the same meaning as the @code{pop-up-frames}
variable and takes precedence over it when present. Its main intended
purpose is to override a non-@code{nil} value of the variable for
particular buffers which the user prefers to keep in the selected frame.
@vindex parent-frame@r{, a buffer display action alist entry}
@item parent-frame

View File

@ -1173,12 +1173,11 @@ to postings you send to the gmane hierarchy, use
send to groups containing the string binaries in their
name etc.
You can instead of specifying a regexp specify a function
which is evaluated, only if it returns true, the
corresponding settings take effect. Two interesting
candidates for this are message-news-p which returns t if
the current Group is a newsgroup and the corresponding
message-mail-p.
You can instead of specifying a regexp specify a function which is
evaluated, only if it returns true, the corresponding settings take
effect. Two interesting candidates for this are @code{message-news-p}
which returns @code{t} if the current Group is a newsgroup and the
corresponding @code{message-mail-p}.
Note that all forms that match are applied, that means in
the example below, when I post to

View File

@ -177,13 +177,13 @@ loading actually occurs. As you might expect, you can use
@end group
@end lisp
The above declarations will load the @samp{foo} package
immediately. In most cases, this is not necessary or desirable, as
that will slow down Emacs startup. Instead, you should try to set
things up so that packages are only loaded when they are actually
needed (a.k.a. ``autoloading''). If you have installed a package from
@acronym{GNU} @acronym{ELPA} that provides it's own autoloads, it is often
enough to say:
The above declarations will load the @samp{foo} package immediately. In
most cases, this is not necessary or desirable, as that will slow down
Emacs startup. Instead, you should try to set things up so that
packages are only loaded when they are actually needed
(``autoloading''). If you have installed a package from @acronym{GNU}
@acronym{ELPA} that provides its own autoloads, it is often enough to
say:
@lisp
@group
@ -252,6 +252,7 @@ on Emacs start. @xref{Installing packages}, for details.
* Forcing loading:: Loading packages immediately.
* Conditional loading:: Loading packages conditionally.
* Loading sequentially:: Loading packages in sequence.
* The @code{emacs} package:: Customizing built-in variables.
* Load dependencies:: Don't load without dependencies.
* Manual installation:: Loading manually installed packages.
@end menu
@ -567,6 +568,34 @@ registers autoloads, such as @code{:bind} or @code{:hook}
it is possible that your package will never be loaded if you do not
add @code{:demand t} to those declarations.
@node The @code{emacs} package
@section Customizing built-in variables
@cindex customizing built-in variables
Some users want to put all their customizations in use-package
declarations, even for variables, hooks, and options that are always
available, without loading any package.@footnote{In other words, they
are either preloaded in Emacs or defined in Emacs' C sources.}
For that purpose, you can use the no-op @samp{emacs} package:
@lisp
@group
(use-package emacs
:init
(setq custom-file "~/.emacs.d/emacs-custom.el")
(load custom-file)
(setq frame-title-format "%b")
:custom
(use-short-answers t))
@end group
@end lisp
This declaration takes advantage of the fact that @w{@code{(featurep
'emacs)}} always returns true, and has no special meaning beyond that.
It simply provides a way to organize your customizations, without
loading anything.
@node Load dependencies
@section Prevent loading if dependencies are missing
@cindex prevent loading package if dependencies are missing

View File

@ -1,5 +1,5 @@
% Reference Card for Org Mode
\def\orgversionnumber{9.7.7}
\def\orgversionnumber{9.7.8}
\def\versionyear{2024} % latest update
\input emacsver.tex

View File

@ -1328,7 +1328,7 @@ is named like ODF with the extension turned to pdf."
"Convert PDF-PS to PNG asynchronously."
(funcall
(pcase doc-view-doc-type
((or 'pdf 'odf 'epub 'cbz 'fb2 'xps 'oxps)
((or 'pdf 'odf 'epub 'cbz 'fb2 'xps 'oxps 'dvi)
doc-view-pdf->png-converter-function)
('djvu #'doc-view-djvu->tiff-converter-ddjvu)
(_ #'doc-view-ps->png-converter-ghostscript))

View File

@ -2217,8 +2217,8 @@ connection if a previous connection has died for some reason."
(unless (tramp-gvfs-connection-mounted-p vec)
(let ((method (tramp-file-name-method vec))
(user (tramp-file-name-user vec))
(host (tramp-file-name-host vec))
(user-domain (tramp-file-name-user-domain vec))
(host-port (tramp-file-name-host-port vec))
(localname (tramp-file-name-unquote-localname vec))
(object-path
(tramp-gvfs-object-path (tramp-make-tramp-file-name vec 'noloc))))
@ -2246,9 +2246,9 @@ connection if a previous connection has died for some reason."
(with-tramp-progress-reporter
vec 3 (format "Opening connection for %s%s using %s"
(if (tramp-string-empty-or-nil-p user)
"" (concat user "@"))
host method)
(if (tramp-string-empty-or-nil-p user-domain)
"" (concat user-domain "@"))
host-port method)
;; Enable `auth-source'.
(tramp-set-connection-property
@ -2296,13 +2296,14 @@ connection if a previous connection has died for some reason."
(with-timeout
((tramp-get-method-parameter
vec 'tramp-connection-timeout tramp-connection-timeout)
(if (tramp-string-empty-or-nil-p (tramp-file-name-user vec))
(if (tramp-string-empty-or-nil-p user-domain)
(tramp-error
vec 'file-error
"Timeout reached mounting %s using %s" host method)
"Timeout reached mounting %s using %s" host-port method)
(tramp-error
vec 'file-error
"Timeout reached mounting %s@%s using %s" user host method)))
"Timeout reached mounting %s@%s using %s"
user-domain host-port method)))
(while (not (tramp-get-file-property vec "/" "fuse-mountpoint"))
(read-event nil nil 0.1)))

View File

@ -275,9 +275,14 @@ NAME must be equal to `tramp-current-connection'."
;;; Integration of shortdoc.el:
(with-eval-after-load 'shortdoc
(dolist (elem '((file-remote-p
(dolist (elem `((file-remote-p
:eval (file-remote-p "/ssh:user@host:/tmp/foo")
:eval (file-remote-p "/ssh:user@host:/tmp/foo" 'method))
:eval (file-remote-p "/ssh:user@host:/tmp/foo" 'method)
:eval (file-remote-p "/ssh:user@[::1]#1234:/tmp/foo" 'host)
;; We don't want to see the text properties.
:no-eval (file-remote-p "/sudo::/tmp/foo" 'user)
:result ,(substring-no-properties
(file-remote-p "/sudo::/tmp/foo" 'user)))
(file-local-name
:eval (file-local-name "/ssh:user@host:/tmp/foo"))
(file-local-copy

View File

@ -5289,7 +5289,7 @@ connection if a previous connection has died for some reason."
"" (concat " " process-name))
(if (tramp-string-empty-or-nil-p l-user)
"" (concat l-user "@"))
l-host l-method)
(tramp-file-name-host-port hop) l-method)
(tramp-send-command vec command t t)
(tramp-process-actions
p vec
@ -5317,7 +5317,7 @@ connection if a previous connection has died for some reason."
(if (tramp-string-empty-or-nil-p
(tramp-file-name-user vec))
"" (concat (tramp-file-name-user vec) "@"))
(tramp-file-name-host vec)
(tramp-file-name-host-port vec)
(tramp-file-name-method vec))
(tramp-open-connection-setup-interactive-shell p vec))

View File

@ -4290,7 +4290,10 @@ Let-bind it when necessary.")
(file-regular-p (file-truename filename))))))))
(defun tramp-handle-file-remote-p (filename &optional identification connected)
"Like `file-remote-p' for Tramp files."
"Like `file-remote-p' for Tramp files.
It supports the additional IDENTIFICATION `hop'.
For the `host' IDENTIFICATION, both host name and port number (if
existing) are returned."
;; We do not want traces in the debug buffer.
(let ((tramp-verbose (min tramp-verbose 3)))
(when (tramp-tramp-file-p filename)
@ -6793,9 +6796,9 @@ Consults the auth-source package."
proc "password-vector" (process-get proc 'tramp-vector)))
(key (tramp-make-tramp-file-name vec 'noloc))
(method (tramp-file-name-method vec))
(user (or (tramp-file-name-user-domain vec)
(tramp-get-connection-property key "login-as")))
(host (tramp-file-name-host-port vec))
(user-domain (or (tramp-file-name-user-domain vec)
(tramp-get-connection-property key "login-as")))
(host-port (tramp-file-name-host-port vec))
(pw-prompt
(string-trim-left
(or prompt
@ -6823,9 +6826,9 @@ Consults the auth-source package."
(setq auth-info
(car
(auth-source-search
:max 1 :user user :host host :port method
:require (cons :secret (and user '(:user)))
:create (and user t)))
:max 1 :user user-domain :host host-port :port method
:require (cons :secret (and user-domain '(:user)))
:create (and user-domain t)))
tramp-password-save-function
(plist-get auth-info :save-function)
auth-passwd

View File

@ -5,13 +5,13 @@
(defun org-release ()
"The release version of Org.
Inserted by installing Org mode or when a release is made."
(let ((org-release "9.7.7"))
(let ((org-release "9.7.8"))
org-release))
;;;###autoload
(defun org-git-version ()
"The Git version of Org mode.
Inserted by installing Org or when a release is made."
(let ((org-git-version "release_9.7.7-2-gf308d3"))
(let ((org-git-version "release_9.7.8-5-gfdf0e0"))
org-git-version))
(provide 'org-version)

View File

@ -9,7 +9,7 @@
;; URL: https://orgmode.org
;; Package-Requires: ((emacs "26.1"))
;; Version: 9.7.7
;; Version: 9.7.8
;; This file is part of GNU Emacs.
;;
@ -19620,7 +19620,7 @@ ELEMENT."
(if level (1+ level) 0))))
((item plain-list) (org-list-item-body-column post-affiliated))
(t
(goto-char start)
(when start (goto-char start))
(current-indentation))))
((memq type '(headline inlinetask nil))
(if (org-match-line "[ \t]*$")
@ -19629,14 +19629,14 @@ ELEMENT."
((memq type '(diary-sexp footnote-definition)) 0)
;; First paragraph of a footnote definition or an item.
;; Indent like parent.
((< (line-beginning-position) start)
((and start (< (line-beginning-position) start))
(org--get-expected-indentation
(org-element-parent element) t))
;; At first line: indent according to previous sibling, if any,
;; ignoring footnote definitions and inline tasks, or parent's
;; contents. If `org-adapt-indentation' is `headline-data', ignore
;; previous headline data siblings.
((= (line-beginning-position) start)
((and start (= (line-beginning-position) start))
(catch 'exit
(while t
(if (= (point-min) start) (throw 'exit 0)
@ -19686,13 +19686,13 @@ ELEMENT."
;; Line above is the first one of a paragraph at the
;; beginning of an item or a footnote definition. Indent
;; like parent.
((< (line-beginning-position) start)
((and start (< (line-beginning-position) start))
(org--get-expected-indentation
(org-element-parent element) t))
;; Line above is the beginning of an element, i.e., point
;; was originally on the blank lines between element's start
;; and contents.
((= (line-beginning-position) post-affiliated)
((and post-affiliated (= (line-beginning-position) post-affiliated))
(org--get-expected-indentation element t))
;; POS is after contents in a greater element. Indent like
;; the beginning of the element.
@ -19780,10 +19780,11 @@ Also align node properties according to `org-property-format'."
(not (org--at-headline-data-p nil element))
;; Not at headline data and previous is headline data/headline.
(or (memq type '(headline inlinetask)) ; blank lines after heading
(save-excursion
(goto-char (1- (org-element-begin element)))
(or (org-at-heading-p)
(org--at-headline-data-p))))))
(and element
(save-excursion
(goto-char (1- (org-element-begin element)))
(or (org-at-heading-p)
(org--at-headline-data-p)))))))
(cond ((and (memq type '(plain-list item))
(= (line-beginning-position)
(org-element-post-affiliated element)))

View File

@ -8771,6 +8771,7 @@ multi-line strings (but not C++, for example)."
;; This function might do hidden buffer changes.
(let ((start (point))
(old-record-type-identifiers c-record-type-identifiers)
(old-found-types (copy-hash-table c-found-types))
;; If `c-record-type-identifiers' is set then activate
;; recording of any found types that constitute an argument in
@ -8807,7 +8808,8 @@ multi-line strings (but not C++, for example)."
(nconc c-record-found-types c-record-type-identifiers)))
t)
(setq c-found-types old-found-types)
(setq c-record-type-identifiers old-record-type-identifiers
c-found-types old-found-types)
(goto-char start)
nil))))

View File

@ -47,40 +47,53 @@
"C-c C-b" #'outline-backward-same-level
"C-c C-n" #'outline-next-visible-heading
"C-c C-p" #'outline-previous-visible-heading
"C-c C-u" #'outline-up-heading)
"C-c C-u" #'outline-up-heading
;; `news-mode' motion commands.
"C-c C-s" #'emacs-news-next-untagged-entry
"C-c C-r" #'emacs-news-previous-untagged-entry
"C-c C-g" #'emacs-news-goto-section
"C-c C-j" #'emacs-news-find-heading
"C-c C-e" #'emacs-news-count-untagged-entries)
(defvar-keymap emacs-news-mode-map
:parent emacs-news-common-map
"C-c C-s" #'emacs-news-next-untagged-entry
"C-c C-r" #'emacs-news-previous-untagged-entry
"C-x C-q" #'emacs-news-view-mode
;; `news-mode' editing commands.
"C-c C-t" #'emacs-news-cycle-tag
"C-c C-d" #'emacs-news-delete-temporary-markers
"C-c C-g" #'emacs-news-goto-section
"C-c C-j" #'emacs-news-find-heading
"C-c C-e" #'emacs-news-count-untagged-entries
"C-x C-q" #'emacs-news-view-mode
"<remap> <open-line>" #'emacs-news-open-line)
(defconst emacs-news-mode--menu-common-1
'(["Next Untagged" emacs-news-next-untagged-entry :help "Go to next untagged entry"]
["Previous Untagged" emacs-news-previous-untagged-entry :help "Go to previous untagged entry"]
["Count Untagged" emacs-news-count-untagged-entries :help "Count the number of untagged entries"]
"--"))
(defconst emacs-news-mode--menu-common-2
'(["Goto Section" emacs-news-goto-section :help "Prompt for section and go to it"]
["Goto Heading" emacs-news-find-heading :help "Prompt for heading and go to it"]
"--"))
(easy-menu-define emacs-news-mode-menu emacs-news-mode-map
"Menu for `emacs-news-mode'."
'("News"
["Next Untagged" emacs-news-next-untagged-entry :help "Go to next untagged entry"]
["Previous Untagged" emacs-news-previous-untagged-entry :help "Go to previous untagged entry"]
["Count Untagged" emacs-news-count-untagged-entries :help "Count the number of untagged entries"]
`("News"
,@emacs-news-mode--menu-common-1
["Cycle Tag" emacs-news-cycle-tag :help "Cycle documentation tag of current entry"]
["Delete Tags" emacs-news-delete-temporary-markers :help "Delete all documentation tags in buffer"]
"--"
["Goto Section" emacs-news-goto-section :help "Prompt for section and go to it"]
["Goto Heading" emacs-news-find-heading :help "Prompt for heading and go to it"]
"--"
,@emacs-news-mode--menu-common-2
["Enter View Mode" emacs-news-view-mode :help "Enter view-only mode"]))
(defvar emacs-news-view-mode-map
;; This is defined this way instead of inheriting because we're
;; deriving the mode from `special-mode' and want the keys from there.
(let ((map (copy-keymap emacs-news-common-map)))
(keymap-set map "C-x C-q" #'emacs-news-mode)
map))
(defvar-keymap emacs-news-view-mode-map
:parent (make-composed-keymap emacs-news-common-map special-mode-map)
"C-x C-q" #'emacs-news-mode)
(easy-menu-define emacs-news-view-mode-menu emacs-news-view-mode-map
"Menu for `emacs-news-view-mode'."
`("News"
,@emacs-news-mode--menu-common-1
,@emacs-news-mode--menu-common-2
["Enter NEWS Mode" emacs-news-mode :help "Enter NEWS mode"]))
(defvar emacs-news-mode-font-lock-keywords
`(("^---$" 0 'emacs-news-does-not-need-documentation)
@ -111,17 +124,7 @@
"Major mode for viewing the Emacs NEWS file."
(setq buffer-read-only t)
(emacs-news--buttonize)
(button-mode)
;; Bind useful browsing keys.
(keymap-local-set "q" 'quit-window)
(keymap-local-set "SPC" 'scroll-up-command)
(keymap-local-set "S-SPC" 'scroll-down-command)
(keymap-local-set "DEL" 'scroll-down-command)
(keymap-local-set "?" 'describe-mode)
(keymap-local-set "h" 'describe-mode)
(keymap-local-set ">" 'end-of-buffer)
(keymap-local-set "<" 'beginning-of-buffer)
(keymap-local-set "g" 'revert-buffer))
(button-mode))
(defun emacs-news--fill-paragraph (&optional justify)
(cond

View File

@ -1328,11 +1328,11 @@ struct image_type
image type. Value is true if SPEC is valid. */
bool (*valid_p) (Lisp_Object spec);
/* Load IMG which is used on frame F from information contained in
IMG->spec. Value is true if successful. */
/* Load IMG which is to be used on frame F from information contained
in IMG->spec. Value is true if successful. */
bool (*load_img) (struct frame *f, struct image *img);
/* Free resources of image IMG which is used on frame F. */
/* Free such resources of image IMG as are used on frame F. */
void (*free_img) (struct frame *f, struct image *img);
#ifdef WINDOWSNT
@ -4154,16 +4154,16 @@ image_destroy_x_image (Emacs_Pix_Container pimg)
eassert (input_blocked_p ());
if (pimg)
{
#ifdef USE_CAIRO
#endif /* USE_CAIRO */
#if defined USE_CAIRO || defined HAVE_HAIKU || defined HAVE_NS
/* On these systems, Emacs_Pix_Containers always point to the same
data as pixmaps in `struct image', and therefore must never be
freed separately. */
#endif /* USE_CAIRO || HAVE_HAIKU || HAVE_NS */
#ifdef HAVE_NTGUI
/* Data will be freed by DestroyObject. */
pimg->data = NULL;
xfree (pimg);
#endif /* HAVE_NTGUI */
#ifdef HAVE_NS
ns_release_object (pimg);
#endif /* HAVE_NS */
}
#endif
}

View File

@ -3026,7 +3026,7 @@ External call (RIF): draw cursor.
Note that CURSOR_WIDTH is meaningful only for (h)bar cursors.
-------------------------------------------------------------------------- */
{
NSRect r, s;
NSRect r;
int fx, fy, h, cursor_height;
struct frame *f = WINDOW_XFRAME (w);
struct glyph *phys_cursor_glyph;
@ -3076,6 +3076,12 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors.
/* The bar cursor should never be wider than the glyph. */
if (cursor_width < w->phys_cursor_width)
w->phys_cursor_width = cursor_width;
/* If the character under cursor is R2L, draw the bar cursor
on the right of its glyph, rather than on the left. */
cursor_glyph = get_phys_cursor_glyph (w);
if ((cursor_glyph->resolved_level & 1) != 0)
fx += cursor_glyph->pixel_width - w->phys_cursor_width;
}
/* If we have an HBAR, "cursor_width" MAY specify height. */
else if (cursor_type == HBAR_CURSOR)
@ -3126,18 +3132,8 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors.
[ctx restoreGraphicsState];
break;
case HBAR_CURSOR:
NSRectFill (r);
[ctx restoreGraphicsState];
break;
case BAR_CURSOR:
s = r;
/* If the character under cursor is R2L, draw the bar cursor
on the right of its glyph, rather than on the left. */
cursor_glyph = get_phys_cursor_glyph (w);
if ((cursor_glyph->resolved_level & 1) != 0)
s.origin.x += cursor_glyph->pixel_width - s.size.width;
NSRectFill (s);
NSRectFill (r);
[ctx restoreGraphicsState];
break;
}

View File

@ -1457,7 +1457,9 @@ an indirect buffer. */)
ts_parser_set_language (parser, lang);
/* Create parser. */
Lisp_Object lisp_parser = make_treesit_parser (Fcurrent_buffer (),
Lisp_Object lisp_buf;
XSETBUFFER (lisp_buf, buf);
Lisp_Object lisp_parser = make_treesit_parser (lisp_buf,
parser, NULL,
language, tag);

View File

@ -28160,7 +28160,7 @@ store_mode_line_string (const char *string, Lisp_Object lisp_string,
DEFUN ("format-mode-line", Fformat_mode_line, Sformat_mode_line,
1, 4, 0,
doc: /* Format a string out of a mode line format specification.
doc: /* Return a string formatted according to mode-line format specification.
First arg FORMAT specifies the mode line format (see `mode-line-format'
for details) to use.

View File

@ -848,19 +848,20 @@ is greater than 10.
(should (string-equal (file-remote-p "/method:[::1]:" 'localname) ""))
(should (string-equal (file-remote-p "/method:[::1]:" 'hop) nil))
;; No expansion.
;; No expansion. Hop.
(should (string-equal
(file-remote-p "/method:user@[::1]:")
(format "/%s:%s@%s:" "method" "user" "[::1]")))
(file-remote-p "/method:user@[::1]#1234:")
(format "/%s:%s@%s#%s:" "method" "user" "[::1]" "1234")))
(should (string-equal
(file-remote-p "/method:user@[::1]:" 'method) "method"))
(should
(string-equal (file-remote-p "/method:user@[::1]:" 'user) "user"))
(should
(string-equal (file-remote-p "/method:user@[::1]:" 'host) "::1"))
(file-remote-p "/method:user@[::1]#1234:" 'method) "method"))
(should (string-equal (file-remote-p "/method:user@[::1]#1234:" 'user)
"user"))
(should (string-equal
(file-remote-p "/method:user@[::1]:" 'localname) ""))
(should (string-equal (file-remote-p "/method:user@[::1]:" 'hop) nil))
(file-remote-p "/method:user@[::1]#1234:" 'host) "::1#1234"))
(should (string-equal
(file-remote-p "/method:user@[::1]#1234:" 'localname) ""))
(should (string-equal
(file-remote-p "/method:user@[::1]#1234:" 'hop) nil))
;; Local file name part.
(should (string-equal (file-remote-p "/-:host:/:" 'localname) "/:"))
@ -1244,6 +1245,20 @@ is greater than 10.
(should (string-equal (file-remote-p "/user@[::1]:" 'localname) ""))
(should (string-equal (file-remote-p "/user@[::1]:" 'hop) nil))
;; No expansion. Hop.
(should (string-equal
(file-remote-p "/user@[::1]#1234:")
(format "/%s@%s#%s:" "user" "[::1]" "1234")))
(should (string-equal
(file-remote-p "/user@[::1]#1234:" 'method) "default-method"))
(should
(string-equal (file-remote-p "/user@[::1]#1234:" 'user) "user"))
(should
(string-equal (file-remote-p "/user@[::1]#1234:" 'host) "::1#1234"))
(should
(string-equal (file-remote-p "/user@[::1]#1234:" 'localname) ""))
(should (string-equal (file-remote-p "/user@[::1]#1234:" 'hop) nil))
;; Local file name part.
(should (string-equal (file-remote-p "/host:/:" 'localname) "/:"))
(should (string-equal (file-remote-p "/host::" 'localname) ":"))
@ -1886,19 +1901,20 @@ is greater than 10.
(should (string-equal (file-remote-p "/[method/::1]" 'localname) ""))
(should (string-equal (file-remote-p "/[method/::1]" 'hop) nil))
;; No expansion.
;; No expansion. Hop.
(should (string-equal
(file-remote-p "/[method/user@::1]")
(format "/[%s/%s@%s]" "method" "user" "::1")))
(file-remote-p "/[method/user@::1#1234]")
(format "/[%s/%s@%s#%s]" "method" "user" "::1" "1234")))
(should (string-equal
(file-remote-p "/[method/user@::1]" 'method) "method"))
(file-remote-p "/[method/user@::1#1234]" 'method) "method"))
(should (string-equal
(file-remote-p "/[method/user@::1]" 'user) "user"))
(file-remote-p "/[method/user@::1#1234]" 'user) "user"))
(should (string-equal
(file-remote-p "/[method/user@::1]" 'host) "::1"))
(file-remote-p "/[method/user@::1#1234]" 'host) "::1#1234"))
(should (string-equal
(file-remote-p "/[method/user@::1]" 'localname) ""))
(should (string-equal (file-remote-p "/[method/user@::1]" 'hop) nil))
(file-remote-p "/[method/user@::1#1234]" 'localname) ""))
(should (string-equal
(file-remote-p "/[method/user@::1#1234]" 'hop) nil))
;; Local file name part.
(should (string-equal (file-remote-p "/[/host]/:" 'localname) "/:"))
@ -2425,16 +2441,22 @@ This checks also `file-name-as-directory', `file-name-directory',
;; which ruins the tests.
(let ((tramp-default-method
(file-remote-p ert-remote-temporary-file-directory 'method))
(host (file-remote-p ert-remote-temporary-file-directory 'host)))
(host-port
(file-remote-p ert-remote-temporary-file-directory 'host)))
(dolist
(file
`(,(format "/%s::" tramp-default-method)
,(format
"/-:%s:"
(if (string-match-p tramp-ipv6-regexp host)
(concat
tramp-prefix-ipv6-format host tramp-postfix-ipv6-format)
host))))
;; `(file-remote-p ... 'host)' eliminates IPv6
;; delimiters. Add them.
(if (string-match tramp-ipv6-regexp host-port)
(replace-match
(format
"%s\\&%s"
tramp-prefix-ipv6-format tramp-postfix-ipv6-format)
nil nil host-port)
host-port))))
(should (string-equal (directory-file-name file) file))
(should
(string-equal
@ -4796,8 +4818,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(host (file-remote-p ert-remote-temporary-file-directory 'host))
(orig-syntax tramp-syntax)
(minibuffer-completing-file-name t))
(when (and (stringp host) (string-match tramp-host-with-port-regexp host))
(setq host (match-string 1 host)))
(when (and (stringp host)
(string-match
(rx (regexp tramp-prefix-port-regexp) (regexp tramp-port-regexp))
host))
(setq host (replace-match "" nil nil host)))
(unwind-protect
(dolist (syntax (if (tramp--test-expensive-test-p)
@ -4930,8 +4955,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(orig-syntax tramp-syntax)
(non-essential t)
(inhibit-message t))
(when (and (stringp host) (string-match tramp-host-with-port-regexp host))
(setq host (match-string 1 host)))
(when (and (stringp host)
(string-match
(rx (regexp tramp-prefix-port-regexp) (regexp tramp-port-regexp))
host))
(setq host (replace-match "" nil nil host)))
;; (trace-function #'tramp-completion-file-name-handler)
;; (trace-function #'completion-file-name-table)