commit a37166eb80458e87880893e7b8aa98a2a7ce394b (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Sat May 26 17:32:56 2018 -0700 Port .gdbinit to unsigned-pointer platforms * src/.gdbinit (Lisp_Object_Printer.to_string): Don’t assume that GDB treats C pointers as signed integers. Problem found with GDB Fedora 8.1-15.fc28. diff --git a/src/.gdbinit b/src/.gdbinit index eb4d57a5fb..7a0cf02ea1 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -1355,7 +1355,7 @@ if hasattr(gdb, 'printing'): if itype == Lisp_Int0 or itype == Lisp_Int1: if USE_LSB_TAG: ival = ival >> (GCTYPEBITS - 1) - elif (ival >> VALBITS) & 1: + if (ival >> VALBITS) & 1: ival = ival | (-1 << VALBITS) else: ival = ival & ((1 << VALBITS) - 1) commit a73e4f53ab86c69fdb8f5869173d6693d73e6fb2 Author: Paul Eggert Date: Sat May 26 16:42:52 2018 -0700 GNOME moved URLs for its active bug reports * src/emacs.c (main) [USE_GTK]: * src/gtkutil.c (xg_display_close): * src/xterm.c (x_connection_closed): Update GNOME bug report URLs. diff --git a/admin/notes/multi-tty b/admin/notes/multi-tty index 9cfe7aacd3..5b34bb598e 100644 --- a/admin/notes/multi-tty +++ b/admin/notes/multi-tty @@ -305,7 +305,7 @@ THINGS TO DO multidisplay (and don't mind core dumps), you can edit src/config.h and define HAVE_GTK_MULTIDISPLAY there by hand. - http://bugzilla.gnome.org/show_bug.cgi?id=85715 + https://gitlab.gnome.org/GNOME/gtk/issues/221 Update: Han reports that GTK+ version 2.8.9 almost gets display disconnects right. GTK will probably be fully fixed by the time diff --git a/configure.ac b/configure.ac index a49b772797..a11abc1b65 100644 --- a/configure.ac +++ b/configure.ac @@ -2684,7 +2684,7 @@ if test x"$pkg_check_gtk" = xyes; then closing open displays. This is no problem if you just use one display, but if you use more than one and close one of them Emacs may crash. - See https://bugzilla.gnome.org/show_bug.cgi?id=85715]]) + See https://gitlab.gnome.org/GNOME/gtk/issues/221]]) fi fi diff --git a/etc/PROBLEMS b/etc/PROBLEMS index d42539061b..fe48febfb7 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -207,7 +207,7 @@ configuring your compiler to use the native linker instead of GNU ld. ** When Emacs is compiled with Gtk+, closing a display kills Emacs. There is a long-standing bug in GTK that prevents it from recovering -from disconnects: http://bugzilla.gnome.org/show_bug.cgi?id=85715. +from disconnects: https://gitlab.gnome.org/GNOME/gtk/issues/221 Thus, for instance, when Emacs is run as a server on a text terminal, and an X frame is created, and the X server for that frame crashes or @@ -225,7 +225,7 @@ The error message is: X protocol error: BadMatch (invalid parameter attributes) on protocol request 140 When compiled with GTK, Emacs cannot recover from X disconnects. - This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715 + This is a GTK bug: https://gitlab.gnome.org/GNOME/gtk/issues/221 For details, see etc/PROBLEMS. Fatal error 6: Aborted diff --git a/src/emacs.c b/src/emacs.c index f25e612664..8633e934e5 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1070,7 +1070,7 @@ main (int argc, char **argv) #endif /* HAVE_LIBSYSTEMD */ #ifdef USE_GTK - fprintf (stderr, "\nWarning: due to a long standing Gtk+ bug\nhttp://bugzilla.gnome.org/show_bug.cgi?id=85715\n\ + fprintf (stderr, "\nWarning: due to a long standing Gtk+ bug\nhttps://gitlab.gnome.org/GNOME/gtk/issues/221\n\ Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost.\n\ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.\n"); #endif /* USE_GTK */ diff --git a/src/gtkutil.c b/src/gtkutil.c index 3f21288f46..8cc523649d 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -258,8 +258,8 @@ xg_display_close (Display *dpy) } #if GTK_CHECK_VERSION (2, 0, 0) && ! GTK_CHECK_VERSION (2, 10, 0) - /* GTK 2.2-2.8 has a bug that makes gdk_display_close crash (bug - http://bugzilla.gnome.org/show_bug.cgi?id=85715). This way we + /* GTK 2.2-2.8 has a bug that makes gdk_display_close crash + . This way we can continue running, but there will be memory leaks. */ g_object_run_dispose (G_OBJECT (gdpy)); #else diff --git a/src/image.c b/src/image.c index 4d5a1bf5e6..992b225d7b 100644 --- a/src/image.c +++ b/src/image.c @@ -9302,7 +9302,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents, /* Set base_uri for properly handling referenced images (via 'href'). See rsvg bug 596114 - "image refs are relative to curdir, not .svg file" - (https://bugzilla.gnome.org/show_bug.cgi?id=596114). */ + . */ if (filename) rsvg_handle_set_base_uri(rsvg_handle, filename); diff --git a/src/xterm.c b/src/xterm.c index 3f956d950d..4bdec7134f 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9828,13 +9828,13 @@ x_connection_closed (Display *dpy, const char *error_message, bool ioerror) current Xt versions, this isn't needed either. */ #ifdef USE_GTK /* A long-standing GTK bug prevents proper disconnect handling - (https://bugzilla.gnome.org/show_bug.cgi?id=85715). Once, + . Once, the resulting Glib error message loop filled a user's disk. To avoid this, kill Emacs unconditionally on disconnect. */ shut_down_emacs (0, Qnil); fprintf (stderr, "%s\n\ When compiled with GTK, Emacs cannot recover from X disconnects.\n\ -This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715\n\ +This is a GTK bug: https://gitlab.gnome.org/GNOME/gtk/issues/221\n\ For details, see etc/PROBLEMS.\n", error_msg); emacs_abort (); commit 6fcab83600317e94ea7b915da7730a8c7e50226d Author: Paul Eggert Date: Sat May 26 13:29:06 2018 -0700 Don’t set EMACS=t if Bash is 4.4 or newer (Thanks to Stefan Monnier for improvements to this patch.) * lisp/term.el (term--bash-needs-EMACS-status): New var. (term--bash-needs-EMACSp): New function. (term-exec-1): Use it instead of always setting EMACS. diff --git a/lisp/term.el b/lisp/term.el index 017b0221ec..19e68ddb49 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -1489,6 +1489,31 @@ Using \"emacs\" loses, because bash disables editing if $TERM == emacs.") ;; don't define :te=\\E[2J\\E[?47l\\E8:ti=\\E7\\E[?47h\ "Termcap capabilities supported.") +;; This private hack is for backwards compatibility with Bash 4.3 and earlier. +;; It can be useful even when running a program other than Bash, as the +;; program might invoke Bash as an interactive subshell. See this thread: +;; https://lists.gnu.org/r/emacs-devel/2018-05/msg00670.html +;; Remove this hack and its uses once Bash 4.4-or-later is reasonably +;; universal, because it slows down execution slightly when +;; term--bash-needs-EMACSp is first called. +(defvar term--bash-needs-EMACS-status nil + "43 if Bash is so old that it needs EMACS set. +Some other integer if Bash is new or not in use. +Nil if unknown.") +(defun term--bash-needs-EMACSp () + "t if Bash is old, nil if it is new or not in use." + (eq 43 + (or term--bash-needs-EMACS-status + (setf + term--bash-needs-EMACS-status + (let ((process-environment + (cons "BASH_ENV" process-environment))) + (condition-case nil + (call-process + "bash" nil nil nil "-c" + "case $BASH_VERSION in [0123].*|4.[0123].*) exit 43;; esac") + (error 0))))))) + ;; This auxiliary function cranks up the process for term-exec in ;; the appropriate environment. @@ -1506,12 +1531,6 @@ Using \"emacs\" loses, because bash disables editing if $TERM == emacs.") (format term-termcap-format "TERMCAP=" term-term-name term-height term-width) - ;; This is for backwards compatibility with Bash 4.3 and earlier. - ;; Remove this hack once Bash 4.4-or-later is common, because - ;; it breaks './configure' of some packages that expect it to - ;; say where to find EMACS. - (format "EMACS=%s (term:%s)" emacs-version term-protocol-version) - (format "INSIDE_EMACS=%s,term:%s" emacs-version term-protocol-version) (format "LINES=%d" term-height) (format "COLUMNS=%d" term-width)) @@ -1523,6 +1542,9 @@ Using \"emacs\" loses, because bash disables editing if $TERM == emacs.") ;; escape codes, so we need to see the raw output. We will have to ;; do the decoding by hand on the parts that are made of chars. (coding-system-for-read 'binary)) + (when (term--bash-needs-EMACSp) + (push (format "EMACS=%s (term:%s)" emacs-version term-protocol-version) + process-environment)) (apply 'start-process name buffer "/bin/sh" "-c" (format "stty -nl echo rows %d columns %d sane 2>/dev/null;\ commit 7dcfdf5b14325ae7996f272f14c72810d7c84944 Author: Tino Calancha Date: Sun May 27 00:58:48 2018 +0900 replace-tests.el: Refactor undo tests * test/lisp/replace-tests.el (replace-tests-bind-read-string): New variable. (replace-tests-with-undo): Add helper macro to generate the boilerplate code. (replace-tests--query-replace-undo, query-replace-undo-bug31073) (query-replace-undo-bug31492, query-replace-undo-bug31538): Use it. diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el index 8123ff0a57..3fcdce6704 100644 --- a/test/lisp/replace-tests.el +++ b/test/lisp/replace-tests.el @@ -23,6 +23,7 @@ ;;; Code: (require 'ert) +(eval-when-compile (require 'subr-x)) (ert-deftest query-replace--split-string-tests () (let ((sep (propertize "\0" 'separator t))) @@ -358,23 +359,71 @@ Each element has the format: (dotimes (i (length replace-occur-tests)) (replace-occur-test-create i)) + +;;; Tests for `query-replace' undo feature. + +(defvar replace-tests-bind-read-string nil + "A string to bind `read-string' and avoid the prompt.") + +(defmacro replace-tests-with-undo (input from to char-nums def-chr &rest body) + "Helper to test `query-replace' undo feature. +INPUT is a string to insert in a temporary buffer. +FROM is the string to match and replace. +TO is the replacement string. +CHAR-NUMS is a list of elements (CHAR . NUMS), where CHAR is +one of the characters `,', `?\\s', `u', `U', `E' or `q' +and NUMS a list of integers. +DEF-CHAR is the character `?\\s' or `q'. +BODY is a list of forms to evaluate. + +Use CHAR-NUMS and DEF-CHAR to temporary bind the function value of +`read-event', thus avoiding the prompt. +For instance, if CHAR-NUMS is the lists ((?\\s . (1 2 3)) (?u . (4))), +then replace 3 matches of FROM with TO, and undo the last replacement. + +Return the last evalled form in BODY." + (declare (indent 5) (debug (stringp stringp stringp form characterp body))) + (let ((text (gensym "text")) + (count (gensym "count"))) + `(let* ((,text ,input) + (,count 0) + (inhibit-message t)) + (with-temp-buffer + (insert ,text) + (goto-char 1) + ;; Bind `read-event' to simulate user input. + ;; If `replace-tests-bind-read-string' is non-nil, then + ;; bind `read-string' as well. + (cl-letf (((symbol-function 'read-event) + (lambda (&rest args) + (cl-incf ,count) + (pcase ,count ; Build the clauses from CHAR-NUMS + ,@(append + (delq nil + (mapcar + (lambda (chr) + (when-let (it (alist-get chr char-nums)) + (if (cdr it) + `(,(cons 'or it) ,chr) + `(,(car it) ,chr)))) + '(?, ?\s ?u ?U ?E ?q))) + `((_ ,def-chr)))))) + ((symbol-function 'read-string) + (if replace-tests-bind-read-string + (lambda (&rest args) replace-tests-bind-read-string) + (symbol-function 'read-string)))) + (perform-replace ,from ,to t t nil)) + ,@body)))) + (defun replace-tests--query-replace-undo (&optional comma) - (with-temp-buffer - (insert "111") - (goto-char 1) - (let ((count 0)) - ;; Don't wait for user input. - (cl-letf (((symbol-function 'read-event) - (lambda (&rest args) - (cl-incf count) - (let ((val (pcase count - ('2 (if comma ?, ?\s)) ; replace and: ',' no move; '\s' go next - ('3 ?u) ; undo - ('4 ?q) ; exit - (_ ?\s)))) ; replace current and go next - val)))) - (perform-replace "1" "2" t nil nil))) - (buffer-string))) + (let ((input "111")) + (if comma + (should + (replace-tests-with-undo + input "1" "2" ((?, . (2)) (?u . (3)) (?q . (4))) ?\s (buffer-string))) + (should + (replace-tests-with-undo + input "1" "2" ((?\s . (2)) (?u . (3)) (?q . (4))) ?\s (buffer-string)))))) (ert-deftest query-replace--undo () (should (string= "211" (replace-tests--query-replace-undo))) @@ -382,64 +431,28 @@ Each element has the format: (ert-deftest query-replace-undo-bug31073 () "Test for https://debbugs.gnu.org/31073 ." - (let ((text "aaa aaa") - (count 0)) - (with-temp-buffer - (insert text) - (goto-char 1) - (cl-letf (((symbol-function 'read-event) - (lambda (&rest args) - (cl-incf count) - (let ((val (pcase count - ((or 1 2 3) ?\s) ; replace current and go next - (4 ?U) ; undo-all - (_ ?q)))) ; exit - val)))) - (perform-replace "a" "B" t nil nil)) - ;; After undo text must be the same. - (should (string= text (buffer-string)))))) + (let ((input "aaa aaa")) + (should + (replace-tests-with-undo + input "a" "B" ((?\s . (1 2 3)) (?U . (4))) ?q + (string= input (buffer-string)))))) (ert-deftest query-replace-undo-bug31492 () "Test for https://debbugs.gnu.org/31492 ." - (let ((text "a\nb\nc\n") - (count 0) - (inhibit-message t)) - (with-temp-buffer - (insert text) - (goto-char 1) - (cl-letf (((symbol-function 'read-event) - (lambda (&rest args) - (cl-incf count) - (let ((val (pcase count - ((or 1 2) ?\s) ; replace current and go next - (3 ?U) ; undo-all - (_ ?q)))) ; exit - val)))) - (perform-replace "^\\|\b\\|$" "foo" t t nil)) - ;; After undo text must be the same. - (should (string= text (buffer-string)))))) + (let ((input "a\nb\nc\n")) + (should + (replace-tests-with-undo + input "^\\|\b\\|$" "foo" ((?\s . (1 2)) (?U . (3))) ?q + (string= input (buffer-string)))))) (ert-deftest query-replace-undo-bug31538 () "Test for https://debbugs.gnu.org/31538 ." - (let ((text "aaa aaa") - (count 0) - (inhibit-message t)) - (with-temp-buffer - (insert text) - (goto-char 1) - (cl-letf (((symbol-function 'read-event) - (lambda (&rest args) - (cl-incf count) - (let ((val (pcase count - ((or 1 2 3) ?\s) ; replace current and go next - (4 ?E) ; edit string - (5 ?U) ; undo-all - (_ ?q)))) ; exit - val))) - ((symbol-function 'read-string) - (lambda (&rest _) "Bfoo"))) - (perform-replace "a" "B" t t nil)) - ;; After undo text must be the same. - (should (string= text (buffer-string)))))) + (let ((input "aaa aaa") + (replace-tests-bind-read-string "Bfoo")) + (should + (replace-tests-with-undo + input "a" "B" ((?\s . (1 2 3)) (?E . (4)) (?U . (5))) ?q + (string= input (buffer-string)))))) + ;;; replace-tests.el ends here commit 9c97d311c32c89d6e884a8bc583ec01c1dfba05b Author: Eli Zaretskii Date: Sat May 26 18:39:16 2018 +0300 ; * etc/NEWS: Call out recently removed aliases in epa.el. diff --git a/etc/NEWS b/etc/NEWS index 0f4c90be75..5ac803eec4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -453,9 +453,18 @@ are formatted as MIME digests. *** 'message-forward-included-headers' has changed its default to exclude most headers when forwarding. -** 'epa-pinentry-mode' is renamed to 'epg-pinentry-mode'. +** EasyPG + +--- +*** 'epa-pinentry-mode' is renamed to 'epg-pinentry-mode'. It now applies to epg functions as well as epa functions. +--- +*** The alias functions 'epa--encode-coding-string', +'epa--decode-coding-string', and 'epa--select-safe-coding-system' have +been removed. Use 'encode-coding-string', 'decode-coding-string', and +'select-safe-coding-system' instead. + * New Modes and Packages in Emacs 27.1 +++ commit 8083c2de699cad2fc3cea51480011605fab56484 Author: Michael Albinus Date: Sat May 26 14:29:06 2018 +0200 Make `tramp-make-tramp-file-name' calls consistent. * lisp/net/tramp.el (tramp-get-buffer) (tramp-handle-file-name-as-directory) (tramp-handle-file-name-directory, tramp-handle-file-remote-p) (tramp-handle-file-truename, tramp-handle-find-backup-file-name) (tramp-handle-insert-file-contents): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-get-remote-uid, tramp-gvfs-get-remote-gid) (tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-sh-handle-file-truename) (tramp-sh-handle-expand-file-name, ) (tramp-sh-handle-process-file, tramp-get-remote-path): * lisp/net/tramp-smb.el (tramp-smb-handle-expand-file-name) (tramp-smb-handle-process-file): Make `tramp-make-tramp-file-name' calls consistent. diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index ac250818ac..f547f84a17 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1054,8 +1054,7 @@ file names." ;; No tilde characters in file name, do normal ;; `expand-file-name' (this does "/./" and "/../"). (tramp-make-tramp-file-name - method user domain host port - (tramp-run-real-handler 'expand-file-name (list localname)))))) + v (tramp-run-real-handler 'expand-file-name (list localname)))))) (defun tramp-gvfs-get-directory-attributes (directory) "Return GVFS attributes association list of all files in DIRECTORY." @@ -1885,20 +1884,15 @@ It was \"a(say)\", but has changed to \"a{sv})\"." "The uid of the remote connection VEC, in ID-FORMAT. ID-FORMAT valid values are `string' and `integer'." (with-tramp-connection-property vec (format "uid-%s" id-format) - (let ((method (tramp-file-name-method vec)) - (user (tramp-file-name-user vec)) - (domain (tramp-file-name-domain vec)) - (host (tramp-file-name-host vec)) - (port (tramp-file-name-port vec)) + (let ((user (tramp-file-name-user vec)) (localname (tramp-get-connection-property vec "default-location" nil))) (cond - ((and user (equal id-format 'string)) user) + ((and (equal id-format 'string) user)) (localname (tramp-compat-file-attribute-user-id (file-attributes - (tramp-make-tramp-file-name method user domain host port localname) - id-format))) + (tramp-make-tramp-file-name vec localname) id-format))) ((equal id-format 'integer) tramp-unknown-id-integer) ((equal id-format 'string) tramp-unknown-id-string))))) @@ -1906,19 +1900,13 @@ ID-FORMAT valid values are `string' and `integer'." "The gid of the remote connection VEC, in ID-FORMAT. ID-FORMAT valid values are `string' and `integer'." (with-tramp-connection-property vec (format "gid-%s" id-format) - (let ((method (tramp-file-name-method vec)) - (user (tramp-file-name-user vec)) - (domain (tramp-file-name-domain vec)) - (host (tramp-file-name-host vec)) - (port (tramp-file-name-port vec)) - (localname + (let ((localname (tramp-get-connection-property vec "default-location" nil))) (cond (localname (tramp-compat-file-attribute-group-id (file-attributes - (tramp-make-tramp-file-name method user domain host port localname) - id-format))) + (tramp-make-tramp-file-name vec localname) id-format))) ((equal id-format 'integer) tramp-unknown-id-integer) ((equal id-format 'string) tramp-unknown-id-string))))) @@ -1960,15 +1948,12 @@ connection if a previous connection has died for some reason." (set-process-query-on-exit-flag p nil))) (unless (tramp-gvfs-connection-mounted-p vec) - (let* ((method (tramp-file-name-method vec)) - (user (tramp-file-name-user vec)) - (domain (tramp-file-name-domain vec)) - (host (tramp-file-name-host vec)) - (port (tramp-file-name-port vec)) - (localname (tramp-file-name-unquote-localname vec)) - (object-path - (tramp-gvfs-object-path - (tramp-make-tramp-file-name method user domain host port "")))) + (let ((method (tramp-file-name-method vec)) + (user (tramp-file-name-user vec)) + (host (tramp-file-name-host vec)) + (localname (tramp-file-name-unquote-localname vec)) + (object-path + (tramp-gvfs-object-path (tramp-make-tramp-file-name vec 'noloc)))) (when (and (string-equal method "afp") (string-equal localname "/")) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 227fd9c356..76dae9cea5 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1125,7 +1125,7 @@ component is used as the target of the symlink." 'file-name-as-directory 'identity) (with-parsed-tramp-file-name (expand-file-name filename) nil (tramp-make-tramp-file-name - method user domain host port + v (with-tramp-file-property v localname "file-truename" (let ((result nil) ; result steps in reverse order (quoted (tramp-compat-file-name-quoted-p localname)) @@ -1177,12 +1177,13 @@ component is used as the target of the symlink." (tramp-compat-file-attribute-type (file-attributes (tramp-make-tramp-file-name - method user domain host port + v (mapconcat 'identity (append '("") (reverse result) (list thisstep)) - "/"))))) + "/") + 'nohop)))) (cond ((string= "." thisstep) (tramp-message v 5 "Ignoring step `.'")) ((string= ".." thisstep) @@ -1226,7 +1227,8 @@ component is used as the target of the symlink." (let (file-name-handler-alist) (setq result (tramp-compat-file-name-quote result)))) (tramp-message v 4 "True name of `%s' is `%s'" localname result) - result)))))) + result)) + 'nohop)))) ;; Basic functions. @@ -2804,11 +2806,9 @@ the result will be a local, non-Tramp, file name." ;; be problems with UNC shares or Cygwin mounts. (let ((default-directory (tramp-compat-temporary-file-directory))) (tramp-make-tramp-file-name - method user domain host port - (tramp-drop-volume-letter - (tramp-run-real-handler - 'expand-file-name (list localname))) - hop))))) + v (tramp-drop-volume-letter + (tramp-run-real-handler + 'expand-file-name (list localname)))))))) ;;; Remote commands: @@ -2997,8 +2997,7 @@ the result will be a local, non-Tramp, file name." (setq input (with-parsed-tramp-file-name infile nil localname)) ;; INFILE must be copied to remote host. (setq input (tramp-make-tramp-temp-file v) - tmpinput - (tramp-make-tramp-file-name method user domain host port input)) + tmpinput (tramp-make-tramp-file-name v input 'nohop)) (copy-file infile tmpinput t))) (when input (setq command (format "%s <%s" command input))) @@ -3031,8 +3030,7 @@ the result will be a local, non-Tramp, file name." ;; stderr must be copied to remote host. The temporary ;; file must be deleted after execution. (setq stderr (tramp-make-tramp-temp-file v) - tmpstderr (tramp-make-tramp-file-name - method user domain host port stderr)))) + tmpstderr (tramp-make-tramp-file-name v stderr 'nohop)))) ;; stderr to be discarded. ((null (cadr destination)) (setq stderr "/dev/null")))) @@ -5294,7 +5292,7 @@ Nonexistent directories are removed from spec." (lambda (x) (and (stringp x) - (file-directory-p (tramp-make-tramp-file-name vec x)) + (file-directory-p (tramp-make-tramp-file-name vec x 'nohop)) x)) remote-path))))) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index c2df2e21bc..0334f052a0 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -715,8 +715,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." ;; No tilde characters in file name, do normal ;; `expand-file-name' (this does "/./" and "/../"). (tramp-make-tramp-file-name - method user domain host port - (tramp-run-real-handler 'expand-file-name (list localname)))))) + v (tramp-run-real-handler 'expand-file-name (list localname)))))) (defun tramp-smb-action-get-acl (proc vec) "Read ACL data from connection buffer." @@ -1235,8 +1234,7 @@ component is used as the target of the symlink." (setq input (with-parsed-tramp-file-name infile nil localname)) ;; INFILE must be copied to remote host. (setq input (tramp-make-tramp-temp-file v) - tmpinput - (tramp-make-tramp-file-name method user domain host port input)) + tmpinput (tramp-make-tramp-file-name v input)) (copy-file infile tmpinput t)) ;; Transform input into a filename powershell does understand. (setq input (format "//%s%s" host input))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 398372883b..1d6e0146c4 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1462,7 +1462,7 @@ necessary only. This function will be used in file name completion." vec "process-buffer" (tramp-get-connection-property vec "process-buffer" nil)) (setq buffer-undo-list t - default-directory (tramp-make-tramp-file-name vec "/" 'nohop)) + default-directory (tramp-make-tramp-file-name vec 'noloc 'nohop)) (current-buffer)))) (defun tramp-get-connection-buffer (vec) @@ -3072,11 +3072,11 @@ User is always nil." ;; Run the command on the localname portion only unless we are in ;; completion mode. (tramp-make-tramp-file-name - v (unless (and (zerop (length (tramp-file-name-localname v))) - (not (tramp-connectable-p file))) - (tramp-run-real-handler - 'file-name-as-directory - (list (or (tramp-file-name-localname v) ""))))))) + v (or (and (zerop (length (tramp-file-name-localname v))) + (not (tramp-connectable-p file))) + (tramp-run-real-handler + 'file-name-as-directory + (list (tramp-file-name-localname v))))))) (defun tramp-handle-file-name-case-insensitive-p (filename) "Like `file-name-case-insensitive-p' for Tramp files." @@ -3153,11 +3153,16 @@ User is always nil." (defun tramp-handle-file-name-directory (file) "Like `file-name-directory' but aware of Tramp files." - (with-parsed-tramp-file-name file nil - (setf (tramp-file-name-localname v) nil) - ;; Run the command on the localname portion only. + ;; Everything except the last filename thing is the directory. We + ;; cannot apply `with-parsed-tramp-file-name', because this expands + ;; the remote file name parts. + (let ((v (tramp-dissect-file-name file t))) + ;; Run the command on the localname portion only. If this returns + ;; nil, mark also the localname part of `v' as nil. (tramp-make-tramp-file-name - v (tramp-run-real-handler'file-name-directory (list localname))))) + v (or (tramp-run-real-handler + 'file-name-directory (list (tramp-file-name-localname v))) + 'noloc)))) (defun tramp-handle-file-name-nondirectory (file) "Like `file-name-nondirectory' but aware of Tramp files." @@ -3202,8 +3207,7 @@ User is always nil." ((eq identification 'host) (tramp-file-name-host-port v)) ((eq identification 'localname) localname) ((eq identification 'hop) hop) - (t (tramp-make-tramp-file-name - method user domain host port "" hop))))))))) + (t (tramp-make-tramp-file-name v 'noloc))))))))) (defun tramp-handle-file-selinux-context (_filename) "Like `file-selinux-context' for Tramp files." @@ -3237,7 +3241,7 @@ User is always nil." result (with-parsed-tramp-file-name (expand-file-name result) v2 (tramp-make-tramp-file-name - v2-method v2-user v2-domain v2-host v2-port + v2 (funcall (if (tramp-compat-file-name-quoted-p v2-localname) 'tramp-compat-file-name-quote 'identity) @@ -3248,7 +3252,8 @@ User is always nil." (tramp-compat-file-name-quote symlink-target)) (expand-file-name symlink-target (file-name-directory v2-localname))) - v2-localname))))) + v2-localname)) + 'nohop))) (when (>= numchase numchase-limit) (tramp-error v1 'file-error @@ -3267,8 +3272,7 @@ User is always nil." (if (and (stringp (cdr x)) (file-name-absolute-p (cdr x)) (not (tramp-tramp-file-p (cdr x)))) - (tramp-make-tramp-file-name - method user domain host port (cdr x) hop) + (tramp-make-tramp-file-name v (cdr x)) (cdr x)))) tramp-backup-directory-alist) backup-directory-alist))) @@ -3373,7 +3377,7 @@ User is always nil." ((stringp remote-copy) (file-local-copy (tramp-make-tramp-file-name - method user domain host port remote-copy))) + v remote-copy 'nohop))) ((stringp tramp-temp-buffer-file-name) (copy-file filename tramp-temp-buffer-file-name 'ok) @@ -3417,9 +3421,7 @@ User is always nil." (or remote-copy (null tramp-temp-buffer-file-name))) (delete-file local-copy)) (when (stringp remote-copy) - (delete-file - (tramp-make-tramp-file-name - method user domain host port remote-copy))))) + (delete-file (tramp-make-tramp-file-name v remote-copy 'nohop))))) ;; Result. (list (expand-file-name filename) commit 91bf38cef5f9e3d73f3b69200ddf46a5b76779af Author: Eli Zaretskii Date: Sat May 26 15:11:20 2018 +0300 * etc/HELLO: Add a few more scripts. diff --git a/etc/HELLO b/etc/HELLO index 3aacbf90a0..db7fd23f1a 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -29,10 +29,17 @@ Bengali (বাংলা) নমস্কার mule-unicode-2500-33ffBraille ⠓⠑⠇⠇⠕ mule-unicode-0100-24ffBurmese (မြန်မာ) မင်္ဂလာပါ C printf ("Hello, world!\n"); -latin-iso8859-2Czech (čeština) Dobrý den +unicodeCherokee (ᏣᎳᎩ ᎦᏬᏂᎯᏍᏗ) ᎣᏏᏲ / ᏏᏲ +Comanche /kəˈmæntʃiː/ Haa marʉ́awe + +Cree (ᓀᐦᐃᔭᐍᐏᐣ) ᑕᓂᓯ / ᐙᒋᔮ + +latin-iso8859-2Czech (čeština) Dobrý den latin-iso8859-1Danish (dansk) Hej / Goddag / Halløj Dutch (Nederlands) Hallo / Dag -unicodeEmacs emacs --no-splash -f view-hello-file +unicodeEfik /ˈɛfɪk/ Mɔkɔm + +Emacs emacs --no-splash -f view-hello-file Emoji 👋 English ipa/ˈɪŋɡlɪʃ/ Hello @@ -48,12 +55,16 @@ Gujarati (ગુજરાતી) નમસ્તે hebrew-iso8859-8Hebrew (עברית) שלום latin-iso8859-2Hungarian (magyar) Szép jó napot! mule-unicode-0100-24ffHindi (हिंदी) नमस्ते / नमस्कार । +unicodeInuktitut (ᐃᓄᒃᑎᑐᑦ) ᐊᐃ + latin-iso8859-1Italian (italiano) Ciao / Buon giorno Javanese (Jawa) System.out.println("Sugeng siang!"); mule-unicode-0100-24ffKannada (ಕನ್ನಡ) ನಮಸ್ಕಾರ Khmer (ភាសាខ្មែរ) ជំរាបសួរ laoLao (ພາສາລາວ) ສະບາຍດີ / ຂໍໃຫ້ໂຊກດີ mule-unicode-0100-24ffMalayalam (മലയാളം) നമസ്കാരം +unicodeMaldivian (ދިވެހި) އައްސަލާމު ޢަލައިކުމް / ކިހިނެހް؟ + latin-iso8859-3Maltese (il-Malti) Bonġu / Saħħa unicodeMathematics ∀ p ∈ world • hello p □ cyrillic-iso8859-5Mongolian (монгол хэл) Сайн байна уу?