commit e4a4aa3057e4ab50ba690fbea3a06e578f62722b (HEAD, refs/remotes/origin/master) Author: Lars Ingebrigtsen Date: Sat Oct 19 10:23:19 2019 +0200 Don't have shr bug out if svg support isn't available * lisp/net/shr.el (shr-put-image): Don't bug out if SVG support isn't available. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index f3d5de9fb6..93408840ab 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1075,7 +1075,8 @@ element is the data blob and the second element is the content-type." (create-image data nil t :ascent 100 :format content-type)) ((eq content-type 'image/svg+xml) - (create-image data 'svg t :ascent 100)) + (when (image-type-available-p 'svg) + (create-image data 'svg t :ascent 100))) ((eq size 'full) (ignore-errors (shr-rescale-image data content-type commit c506e45c616f95f8710a38a69eb8ef8a41e50d26 Author: Cédric Chépied Date: Sat Oct 19 09:54:02 2019 +0200 Fix typo in tree-widget-lookup-image * lisp/tree-widget.el (tree-widget-lookup-image): Fix typo introduced by previous cleanup (bug#37809). diff --git a/lisp/tree-widget.el b/lisp/tree-widget.el index 274a1b8b81..660b4b7683 100644 --- a/lisp/tree-widget.el +++ b/lisp/tree-widget.el @@ -371,7 +371,7 @@ found." (file-regular-p file) (throw 'found (apply #'create-image - (car fmt) file nil + file (car fmt) nil (tree-widget-image-properties name)))))))) nil))) commit 2a3577ba11e391838f3f5dfdf48ae5a0c16b9301 Author: Eli Zaretskii Date: Sat Oct 19 10:42:14 2019 +0300 A better fix for tab-line mouse highlight on TTY frames * src/dispnew.c (mode_line_string): * src/xdisp.c (note_mode_line_or_margin_highlight): Remove recently-added workarounds for incorrect TTY mouse highlight: they are no longer needed. (mark_window_display_accurate_1): Set the header_line_p and tab_line_p flags of the window's current_matrix if the window displays these. (display_mode_line): Set the header_line_p and tab_line_p flags of the window's desired_matrix if the window displays these. (Bug#37807) diff --git a/src/dispnew.c b/src/dispnew.c index 47bf3c26cb..4cdc76f5bc 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -5517,15 +5517,7 @@ mode_line_string (struct window *w, enum window_part part, else if (part == ON_TAB_LINE) row = MATRIX_TAB_LINE_ROW (w->current_matrix); else - { - row = MATRIX_HEADER_LINE_ROW (w->current_matrix); - /* On TTY frames the matrix's tab_line_p flag is not set - (FIXME!), so we need to adjust by hand. */ - if (!FRAME_WINDOW_P (XFRAME (w->frame)) - && window_wants_tab_line (w)) - - row++; - } + row = MATRIX_HEADER_LINE_ROW (w->current_matrix); y0 = *y - row->y; *y = row - MATRIX_FIRST_TEXT_ROW (w->current_matrix); diff --git a/src/xdisp.c b/src/xdisp.c index 0d8f9a1edd..8cbda08efc 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -15988,6 +15988,8 @@ mark_window_display_accurate_1 (struct window *w, bool accurate_p) w->current_matrix->buffer = b; w->current_matrix->begv = BUF_BEGV (b); w->current_matrix->zv = BUF_ZV (b); + w->current_matrix->header_line_p = window_wants_header_line (w); + w->current_matrix->tab_line_p = window_wants_tab_line (w); w->last_cursor_vpos = w->cursor.vpos; w->last_cursor_off_p = w->cursor_off_p; @@ -24947,7 +24949,12 @@ display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format) it.glyph_row->mode_line_p = true; if (face_id == TAB_LINE_FACE_ID) - it.glyph_row->tab_line_p = true; + { + it.glyph_row->tab_line_p = true; + w->desired_matrix->tab_line_p = true; + } + else if (face_id == HEADER_LINE_FACE_ID) + w->desired_matrix->header_line_p = true; /* FIXME: This should be controlled by a user option. But supporting such an option is not trivial, since the mode line is @@ -32488,11 +32495,6 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, ? MATRIX_TAB_LINE_ROW (w->current_matrix) : MATRIX_HEADER_LINE_ROW (w->current_matrix))); - /* On TTY frames the matrix's tab_line_p flag is not set - (FIXME!), so we need to adjust by hand. */ - if (!FRAME_WINDOW_P (f) && area == ON_HEADER_LINE - && window_wants_tab_line (w)) - row++; /* Find the glyph under the mouse pointer. */ if (row->mode_line_p && row->enabled_p) { @@ -32707,11 +32709,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, ? (w->current_matrix)->nrows - 1 : (area == ON_TAB_LINE ? 0 - : ((w->current_matrix->tab_line_p - /* The window_wants_tab_line test is for TTY - frames where the tab_line_p flag is not - set (FIXME!). */ - || window_wants_tab_line (w)) + : (w->current_matrix->tab_line_p ? 1 : 0))); commit 23520fe33978030213026b5cb9be2e9ca62a31da Author: Stefan Kangas Date: Sat Oct 19 01:12:33 2019 +0200 Remove XEmacs compat code from ezimage.el * lisp/ezimage.el (top-level): Remove XEmacs compat code. diff --git a/lisp/ezimage.el b/lisp/ezimage.el index f2b62b27fa..fc498aac32 100644 --- a/lisp/ezimage.el +++ b/lisp/ezimage.el @@ -29,14 +29,11 @@ ;; The idea is that gui buffers (trees, buttons, etc) will have text ;; representations of the GUI elements. These routines will replace the text ;; with an image when images are available. -;; -;; This file requires the `image' package if it is available. - -(condition-case nil ; for older XEmacs - (require 'image) - (error nil)) ;;; Code: + +(require 'image) + (defcustom ezimage-use-images (and (display-images-p) (image-type-available-p 'xpm)) "Non-nil means ezimage should display icons." commit f9744a5f09fe3d786de8dfb264598bf4d77ece8c Author: Paul Eggert Date: Fri Oct 18 15:33:13 2019 -0700 Pacify x86 GCC 9 in tab bar code * src/xdisp.c (tty_get_tab_bar_item): Simplify a bit. This pacifies --enable-gcc-warnings with x86 GCC 9.2.1 20190827 (Red Hat 9.2.1-1) when combined with -fsanitize=undefined. diff --git a/src/xdisp.c b/src/xdisp.c index 457fa4343f..0d8f9a1edd 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13419,26 +13419,22 @@ static Lisp_Object tty_get_tab_bar_item (struct frame *f, int x, int *idx, ptrdiff_t *end) { ptrdiff_t clen = 0; - Lisp_Object caption; - int i, j; - for (i = 0, j = 0; i < f->n_tab_bar_items; i++, j += TAB_BAR_ITEM_NSLOTS) + for (int i = 0; i < f->n_tab_bar_items; i++) { - caption = AREF (f->tab_bar_items, j + TAB_BAR_ITEM_CAPTION); + Lisp_Object caption = AREF (f->tab_bar_items, (i * TAB_BAR_ITEM_NSLOTS + + TAB_BAR_ITEM_CAPTION)); if (NILP (caption)) return Qnil; clen += SCHARS (caption); if (x < clen) - break; - } - if (i < f->n_tab_bar_items) - { - *idx = i; - *end = clen; - return caption; + { + *idx = i; + *end = clen; + return caption; + } } - else - return Qnil; + return Qnil; } /* Handle a mouse click at X/Y on the tab bar of TTY frame F. If the commit f60ed6e3e4f580d9d967fac28e345aca911ca04f Author: Stefan Kangas Date: Fri Oct 18 23:32:30 2019 +0200 Remove XEmacs compat code from edt-mapper.el * lisp/emulation/edt-mapper.el (edt-mapper, edt-xserver) (edt-map-key): Remove XEmacs compat code. (edt-window-system): Redefine as obsolete variable alias for 'window-system'. diff --git a/lisp/emulation/edt-mapper.el b/lisp/emulation/edt-mapper.el index 4aad72caf3..4c80022cfb 100644 --- a/lisp/emulation/edt-mapper.el +++ b/lisp/emulation/edt-mapper.el @@ -55,8 +55,8 @@ ;; Usage: -;; Simply load this file into emacs (version 19 or higher) -;; and run the function edt-mapper, using the following command. +;; Simply load this file into emacs and run the function edt-mapper, +;; using the following command. ;; emacs -q -l edt-mapper -f edt-mapper @@ -96,23 +96,17 @@ ;;; Code: ;;; -;;; Decide Emacs Variant, GNU Emacs or XEmacs (aka Lucid Emacs). ;;; Determine Window System, and X Server Vendor (if appropriate). ;;; -(defconst edt-window-system (if (featurep 'xemacs) (console-type) window-system) - "Indicates window system (in GNU Emacs) or console type (in XEmacs).") +(define-obsolete-variable-alias 'edt-window-system 'window-system "27.1") -(declare-function x-server-vendor "xfns.c" (&optional terminal)) - -(defconst edt-xserver (when (eq edt-window-system 'x) +(defconst edt-xserver (when (eq window-system 'x) ;; The Cygwin window manager has a `/' in its ;; name, which breaks the generated file name of ;; the custom key map file. Replace `/' with a ;; `-' to work around that. - (if (featurep 'xemacs) - (replace-in-string (x-server-vendor) "[ /]" "-") - (replace-regexp-in-string "[ /]" "-" - (x-server-vendor)))) + (replace-regexp-in-string "[ /]" "-" + (x-server-vendor))) "Indicates X server vendor name, if applicable.") @@ -138,40 +132,26 @@ ;;; (defun edt-map-key (ident descrip) (interactive) - (if (featurep 'xemacs) - (progn - (setq edt-key-seq (read-key-sequence (format "Press %s%s: " ident descrip))) - (setq edt-key (concat "[" (format "%s" (event-key (aref edt-key-seq 0))) "]")) - (cond ((not (equal edt-key edt-return)) - (set-buffer "Keys") - (insert (format " (\"%s\" . %s)\n" ident edt-key)) - (set-buffer "Directions")) - ;; bogosity to get next prompt to come up, if the user hits ! - ;; check periodically to see if this is still needed... - (t - (set-buffer "Keys") - (insert (format " (\"%s\" . \"\" )\n" ident)) - (set-buffer "Directions")))) - (setq edt-key (read-key-sequence (format "Press %s%s: " ident descrip))) - (cond ((not (equal edt-key edt-return)) - (set-buffer "Keys") - (insert (if (vectorp edt-key) - (format " (\"%s\" . %s)\n" ident edt-key) - (format " (\"%s\" . \"%s\")\n" ident edt-key))) - (set-buffer "Directions")) - ;; bogosity to get next prompt to come up, if the user hits ! - ;; check periodically to see if this is still needed... - (t - (set-buffer "Keys") - (insert (format " (\"%s\" . \"\" )\n" ident)) - (set-buffer "Directions")))) + (setq edt-key (read-key-sequence (format "Press %s%s: " ident descrip))) + (cond ((not (equal edt-key edt-return)) + (set-buffer "Keys") + (insert (if (vectorp edt-key) + (format " (\"%s\" . %s)\n" ident edt-key) + (format " (\"%s\" . \"%s\")\n" ident edt-key))) + (set-buffer "Directions")) + ;; bogosity to get next prompt to come up, if the user hits ! + ;; check periodically to see if this is still needed... + (t + (set-buffer "Keys") + (insert (format " (\"%s\" . \"\" )\n" ident)) + (set-buffer "Directions"))) edt-key) (defun edt-mapper () (if noninteractive (user-error "edt-mapper cannot be loaded in batch mode")) ;; Determine Terminal Type (if appropriate). - (if (and edt-window-system (not (eq edt-window-system 'tty))) + (if (and window-system (not (eq window-system 'tty))) (setq edt-term nil) (setq edt-term (getenv "TERM"))) ;; @@ -218,7 +198,7 @@ ;; Make sure the window is big enough to display the instructions, ;; except where window cannot be re-sized. ;; - (if (and edt-window-system (not (eq edt-window-system 'tty))) + (if (and window-system (not (eq window-system 'tty))) (set-frame-size (selected-frame) 80 36)) ;; ;; Create buffers - Directions and Keys @@ -242,7 +222,7 @@ ;; Display directions ;; (switch-to-buffer "Directions") - (if (and edt-window-system (not (eq edt-window-system 'tty))) + (if (and window-system (not (eq window-system 'tty))) (insert " EDT MAPPER @@ -289,19 +269,14 @@ ;; ;; Save for future reference. ;; - ;; For GNU Emacs, running in a Window System, first hide bindings in + ;; For Emacs running in a Window System, first hide bindings in ;; function-key-map. ;; - (cond - ((featurep 'xemacs) - (setq edt-return-seq (read-key-sequence "Hit carriage-return to continue ")) - (setq edt-return (concat "[" (format "%s" (event-key (aref edt-return-seq 0))) "]"))) - (t - (if edt-window-system - (progn - (setq edt-save-function-key-map function-key-map) - (setq function-key-map (make-sparse-keymap)))) - (setq edt-return (read-key-sequence "Hit carriage-return to continue ")))) + (if window-system + (progn + (setq edt-save-function-key-map function-key-map) + (setq function-key-map (make-sparse-keymap)))) + (setq edt-return (read-key-sequence "Hit carriage-return to continue ")) ;; ;; Remove prefix-key bindings to F1 and F2 in global-map so they can be @@ -315,7 +290,7 @@ ;; (set-buffer "Directions") (delete-region (point-min) (point-max)) - (if (and edt-window-system (not (eq edt-window-system 'tty))) + (if (and window-system (not (eq window-system 'tty))) (insert " PRESS THE KEY SPECIFIED IN THE MINIBUFFER BELOW. @@ -506,7 +481,7 @@ ;; ;; Restore function-key-map. ;; - (if (and edt-window-system (not (featurep 'xemacs))) + (if window-system (setq function-key-map edt-save-function-key-map)) (setq EDT-key-name "") (while (not @@ -529,10 +504,10 @@ ;; Save the key mapping file ;; (let ((file (concat - "~/.edt-" (if (featurep 'xemacs) "xemacs" "gnu") + "~/.edt-gnu" (if edt-term (concat "-" edt-term)) (if edt-xserver (concat "-" edt-xserver)) - (if edt-window-system (concat "-" (upcase (symbol-name edt-window-system)))) + (if window-system (concat "-" (upcase (symbol-name window-system)))) "-keys"))) (set-visited-file-name (read-file-name (format "Save key mapping to file (default %s): " file) nil file))) commit 2afab0d9ce38dbd597ca839e3dd3fb8e3869781e Author: Stefan Kangas Date: Fri Oct 18 23:26:46 2019 +0200 Remove XEmacs compat code from esh-arg.el * lisp/eshell/esh-arg.el (eshell-quote-backslash): Remove XEmacs compat code. diff --git a/lisp/eshell/esh-arg.el b/lisp/eshell/esh-arg.el index 4685095826..021b622239 100644 --- a/lisp/eshell/esh-arg.el +++ b/lisp/eshell/esh-arg.el @@ -302,13 +302,7 @@ Point is left at the end of the arguments." "Intelligently backslash the character occurring in STRING at INDEX. If the character is itself a backslash, it needs no escaping." (let ((char (aref string index))) - (if (and (eq char ?\\) - ;; In Emacs directory-sep-char is always ?/, so this does nothing. - (not (and (featurep 'xemacs) - (featurep 'mswindows) - (eq directory-sep-char ?\\) - (eq (1- (string-width string)) - index)))) + (if (eq char ?\\) (char-to-string char) (if (memq char eshell-special-chars-outside-quoting) (string ?\\ char))))) commit f3aa05b1aad055452093350785ea05d4a64142dd Author: Paul Eggert Date: Fri Oct 18 13:21:11 2019 -0700 Generalize list1i etc. to all signed integer types * src/lisp.h (list1i, list2i, list3i, list4i): Accept intmax_t instead of EMACS_INT, and use make_int instead of make_fixnum. This should help avoid integer-overflow problems akin to the Time bug (Bug#37795). diff --git a/src/lisp.h b/src/lisp.h index fe20add2d7..04fa1d64ea 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3862,28 +3862,27 @@ extern void visit_static_gc_roots (struct gc_root_visitor visitor); /* Build a frequently used 1/2/3/4-integer lists. */ INLINE Lisp_Object -list1i (EMACS_INT x) +list1i (intmax_t a) { - return list1 (make_fixnum (x)); + return list1 (make_int (a)); } INLINE Lisp_Object -list2i (EMACS_INT x, EMACS_INT y) +list2i (intmax_t a, intmax_t b) { - return list2 (make_fixnum (x), make_fixnum (y)); + return list2 (make_int (a), make_int (b)); } INLINE Lisp_Object -list3i (EMACS_INT x, EMACS_INT y, EMACS_INT w) +list3i (intmax_t a, intmax_t b, intmax_t c) { - return list3 (make_fixnum (x), make_fixnum (y), make_fixnum (w)); + return list3 (make_int (a), make_int (b), make_int (c)); } INLINE Lisp_Object -list4i (EMACS_INT x, EMACS_INT y, EMACS_INT w, EMACS_INT h) +list4i (intmax_t a, intmax_t b, intmax_t c, intmax_t d) { - return list4 (make_fixnum (x), make_fixnum (y), - make_fixnum (w), make_fixnum (h)); + return list4 (make_int (a), make_int (b), make_int (c), make_int (d)); } extern Lisp_Object make_uninit_bool_vector (EMACS_INT); commit b72ff3667a137ca5d03f6a5c3cff722f004bc8ed Author: Paul Eggert Date: Fri Oct 18 13:07:49 2019 -0700 Fix integer-overflow bug in Time conversion Problem reported by Stefan Monnier (Bug#37795). * src/keyboard.c (make_lispy_position) (make_scroll_bar_position, make_lispy_event): * src/xterm.c (x_ewmh_activate_frame): Use INT_TO_INTEGER to convert Time to a Lisp integer, since the value might not be a fixnum. diff --git a/src/keyboard.c b/src/keyboard.c index d67d18a801..db583ec530 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5242,7 +5242,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, Fcons (posn, Fcons (Fcons (make_fixnum (xret), make_fixnum (yret)), - Fcons (make_fixnum (t), + Fcons (INT_TO_INTEGER (t), extra_info)))); } @@ -5267,7 +5267,7 @@ static Lisp_Object make_scroll_bar_position (struct input_event *ev, Lisp_Object type) { return list5 (ev->frame_or_window, type, Fcons (ev->x, ev->y), - make_fixnum (ev->timestamp), + INT_TO_INTEGER (ev->timestamp), builtin_lisp_symbol (scroll_bar_parts[ev->part])); } @@ -5579,7 +5579,7 @@ make_lispy_event (struct input_event *event) position = list4 (event->frame_or_window, Qmenu_bar, Fcons (event->x, event->y), - make_fixnum (event->timestamp)); + INT_TO_INTEGER (event->timestamp)); return list2 (item, position); } diff --git a/src/xterm.c b/src/xterm.c index 5d8b1482a6..045589534f 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11589,7 +11589,8 @@ x_ewmh_activate_frame (struct frame *f) x_send_client_event (frame, make_fixnum (0), frame, dpyinfo->Xatom_net_active_window, make_fixnum (32), - list2i (1, dpyinfo->last_user_time)); + list2 (make_fixnum (1), + INT_TO_INTEGER (dpyinfo->last_user_time))); } } commit 36c75c2a413beebc0b5163ba962cacfcea36db02 Author: Michael Albinus Date: Fri Oct 18 19:45:07 2019 +0200 * test/lisp/net/tramp-tests.el (remote-file-name-inhibit-cache): Set to nil. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 37021d6c93..128d099ac2 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -100,11 +100,12 @@ (setq auth-source-save-behavior nil password-cache-expiry nil - tramp-verbose 0 + remote-file-name-inhibit-cache nil tramp-cache-read-persistent-data t ;; For auth-sources. tramp-copy-size-limit nil tramp-message-show-message nil - tramp-persistency-file-name nil) + tramp-persistency-file-name nil + tramp-verbose 0) ;; This should happen on hydra only. (when (getenv "EMACS_HYDRA_CI") commit 7c58cca134f827ca57d16d4126dc0247248b43bb Author: Michael Albinus Date: Fri Oct 18 19:44:49 2019 +0200 Support old Samba versions in Tramp * doc/misc/tramp.texi (Relevant connection properties to override): New subsection. * lisp/net/tramp-smb.el (tramp-smb-get-cifs-capabilities): Check "posix" connection property. * lisp/net/tramp.el (with-tramp-progress-reporter): Fix docstring. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index f34484ba71..0252620eb7 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -1170,8 +1170,8 @@ of the configured system storage. Optional flags to the different @option{rclone} operations could be passed as connection property, @xref{Predefined connection -information}. Supported properties are @samp{mount-args}, -@samp{copyto-args} and @samp{moveto-args}. +information}. Supported properties are @t{"mount-args"}, +@t{"copyto-args"} and @t{"moveto-args"}. Access via @option{rclone} is slow. If you have an alternative method for accessing the system storage, you shall prefer this. @@ -1954,7 +1954,7 @@ property's value. @var{property} is any method specific parameter contained in @code{tramp-methods}. The parameter key in @code{tramp-methods} is a symbol name @code{tramp-}. To overwrite that property, use the -string @samp{} for @var{property}. For example, this changes the +string @t{""} for @var{property}. For example, this changes the remote shell: @lisp @@ -1975,37 +1975,73 @@ The parameters @code{tramp-remote-shell} and @code{tramp-remote-shell-login} in @code{tramp-methods} now have new values for the remote host. -A common use case is to override the session timeout of a connection, -that is the time (in seconds) after a connection is disabled, and must -be reestablished. This can be set for any connection; for the -@option{sudo} and @option{doas} methods there exist predefined values. -A value of @code{nil} disables this feature. For example: +@var{property} could also be any property found in +@code{tramp-persistency-file-name}. -@lisp -@group -(add-to-list 'tramp-connection-properties - (list (regexp-quote "@trampfn{sudo,root@@system-name,}") - "session-timeout" 30)) -@end group -@end lisp -@noindent -@samp{system-name} stands here for the host returned by the function -@command{(system-name)}. +@subsection Relevant connection properties to override -@var{property} could also be any property found in -@code{tramp-persistency-file-name}. +Not all connection properties need to be changed. The most relevant +properties are listed here: -To get around how restricted shells randomly drop connections, set the -special property @samp{busybox}. For example: +@itemize +@item @t{"login-program"} -@lisp -@group -(add-to-list 'tramp-connection-properties - (list (regexp-quote "@trampfn{ssh,user@@randomhost.your.domain,}") - "busybox" t)) -@end group -@end lisp +The property @t{"login-program"} keeps the program to be called in +order to connect the remote host. Sometimes, the program might have +another name on your host, or it is located on another path. In this +case, you can overwrite the default value, which is special for every +connection method. It is used in all connection methods of +@file{tramp-sh.el}. + +@item @t{"login-args"} + +@t{"login-args"} specifies a list of lists of arguments to pass to +@t{"login-program"}. Read the docstring of @code{tramp-methods} how +to construct these lists. + +@item @t{"remote-shell"} + +This property tells Tramp which remote shell to apply on the remote +host. It is used in all connection methods of @file{tramp-sh.el}. +The default value is @t{"/bin/sh"}. + +@item @t{"remote-shell-login"} + +A property to be used in conjunction with @t{"remote-shell"}. It +specifies, which shell argument triggers a login shell. Its default +value is @t{"-l"}, but some shells, like @command{ksh}, prefer +@t{"-"}. + +@item @t{"session-timeout"} + +All @file{tramp-sh.el} based methods accept the property +@t{"session-timeout"}. This is the time (in seconds) after a +connection is disabled for security reasons, and must be +reestablished. A value of @code{nil} disables this feature. Most of +the methods do not set this property except the @option{sudo} and +@option{doas} methods, which use predefined values. + +@item @t{"posix"} + +Connections using the @option{smb} method check, whether the remote +host supports posix commands. If the remote host runs Samba, it +confirms this capability. However, some very old Samba versions have +errors in their implementation. In order to suppress the posix +commands for those hosts, the property @t{"posix"} shall be set to +@code{nil}. + +The default value of this property is @code{t} (not specified in +@code{tramp-methods}). If the remote host runs native MS Windows, +there is no effect of this property. + +@item @t{"mount-args"}@* +@t{"copyto-args"}@* +@t{"moveto-args"} + +These properties keep optional flags to the different @option{rclone} +operations. Their default value is @code{nil}. +@end itemize @node Remote programs @@ -2106,7 +2142,7 @@ be recomputed. To force @value{tramp} to recompute afresh, call Per default, @value{tramp} uses the command @command{/bin/sh} for starting a shell on the remote host. This can be changed by setting -the connection property @option{remote-shell}, see @xref{Predefined +the connection property @t{"remote-shell"}, see @xref{Predefined connection information}. If you want, for example, use @command{/usr/bin/zsh} on a remote host, you might apply @@ -2215,7 +2251,7 @@ prompts, for which @value{tramp} uses @code{tramp-wrong-passwd-regexp}. @value{tramp} uses the user option @code{tramp-terminal-type} to set the remote environment variable @env{TERM} for the shells it runs. -Per default, it is @samp{"dumb"}, but this could be changed. A dumb +Per default, it is @t{"dumb"}, but this could be changed. A dumb terminal is best suited to run the background sessions of @value{tramp}. However, running interactive remote shells might require a different setting. This could be achieved by tweaking the @@ -3782,10 +3818,10 @@ following line to @file{~/.zshrc}: [[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return @end example -This uses the default value of @code{tramp-terminal-type}, -@samp{"dumb"}, as value of the @env{TERM} environment variable. If -you want to use another value for @env{TERM}, change -@code{tramp-terminal-type} and this line accordingly. +This uses the default value of @code{tramp-terminal-type}, @t{"dumb"}, +as value of the @env{TERM} environment variable. If you want to use +another value for @env{TERM}, change @code{tramp-terminal-type} and +this line accordingly. Alternatively, you could set the remote login shell explicitly. See @ref{Remote shell setup} for discussion of this technique, diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index b008e6b25e..2a9cf6a6d7 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -1814,8 +1814,13 @@ Result is the list (LOCALNAME MODE SIZE MTIME)." (defun tramp-smb-get-cifs-capabilities (vec) "Check, whether the SMB server supports POSIX commands." - ;; When we are not logged in yet, we return nil. - (if (process-live-p (tramp-get-connection-process vec)) + ;; When we are not logged in yet, we return nil. The + ;; connection-local property "posix" is not set explicitly; it is + ;; just checked in order to let a user configure it to nil on hosts + ;; which return cifs properties, but lack a proper implementation. + ;; Very old Samba implementations, for example. + (if (and (process-live-p (tramp-get-connection-process vec)) + (tramp-get-connection-property vec "posix" t)) (with-tramp-connection-property (tramp-get-connection-process vec) "cifs-capabilities" (save-match-data diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 84a6febf24..6ff313e8fb 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1922,7 +1922,7 @@ If VAR is nil, then we bind `v' to the structure and `method', `user', (tramp-compat-progress-reporter-update reporter value suffix)))) (defmacro with-tramp-progress-reporter (vec level message &rest body) - "Executes BODY, spinning a progress reporter with MESSAGE. + "Execute BODY, spinning a progress reporter with MESSAGE. If LEVEL does not fit for visible messages, there are only traces without a visible progress reporter." (declare (indent 3) (debug t)) commit 2c9128ce1352d8098d6bbd43d081a0fb07cfff8f Author: Eli Zaretskii Date: Fri Oct 18 18:48:31 2019 +0300 Fix mouse highlight with tab-line on TTY frames * src/xdisp.c (note_mode_line_or_margin_highlight): * src/dispnew.c (mode_line_string): Fix mouse highlight on TTY frames when both header line and tab-line are displayed. (Bug#37807) diff --git a/src/dispnew.c b/src/dispnew.c index 4cdc76f5bc..47bf3c26cb 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -5517,7 +5517,15 @@ mode_line_string (struct window *w, enum window_part part, else if (part == ON_TAB_LINE) row = MATRIX_TAB_LINE_ROW (w->current_matrix); else - row = MATRIX_HEADER_LINE_ROW (w->current_matrix); + { + row = MATRIX_HEADER_LINE_ROW (w->current_matrix); + /* On TTY frames the matrix's tab_line_p flag is not set + (FIXME!), so we need to adjust by hand. */ + if (!FRAME_WINDOW_P (XFRAME (w->frame)) + && window_wants_tab_line (w)) + + row++; + } y0 = *y - row->y; *y = row - MATRIX_FIRST_TEXT_ROW (w->current_matrix); diff --git a/src/xdisp.c b/src/xdisp.c index 30be492d9b..457fa4343f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -32492,6 +32492,11 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, ? MATRIX_TAB_LINE_ROW (w->current_matrix) : MATRIX_HEADER_LINE_ROW (w->current_matrix))); + /* On TTY frames the matrix's tab_line_p flag is not set + (FIXME!), so we need to adjust by hand. */ + if (!FRAME_WINDOW_P (f) && area == ON_HEADER_LINE + && window_wants_tab_line (w)) + row++; /* Find the glyph under the mouse pointer. */ if (row->mode_line_p && row->enabled_p) { @@ -32706,7 +32711,11 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, ? (w->current_matrix)->nrows - 1 : (area == ON_TAB_LINE ? 0 - : (w->current_matrix->tab_line_p + : ((w->current_matrix->tab_line_p + /* The window_wants_tab_line test is for TTY + frames where the tab_line_p flag is not + set (FIXME!). */ + || window_wants_tab_line (w)) ? 1 : 0))); commit 5fd1c086e7c6e182893e727444faa33de1c62650 Author: Eli Zaretskii Date: Fri Oct 18 17:55:21 2019 +0300 Fix handling of mouse events on header line with tab-line * src/window.c (coordinates_in_window): Fix conditions for coordinates being on the window's header line when that window also displays a tab-line. (Bug#37807) diff --git a/src/window.c b/src/window.c index e4bb2daeb3..0fa0bdf7b9 100644 --- a/src/window.c +++ b/src/window.c @@ -1321,8 +1321,10 @@ coordinates_in_window (register struct window *w, int x, int y) && y < top_y + CURRENT_TAB_LINE_HEIGHT (w) && (part = ON_TAB_LINE)) || (window_wants_header_line (w) - && y < top_y + CURRENT_TAB_LINE_HEIGHT (w) - + CURRENT_HEADER_LINE_HEIGHT (w) + && y < top_y + CURRENT_HEADER_LINE_HEIGHT (w) + + (window_wants_tab_line (w) + ? CURRENT_TAB_LINE_HEIGHT (w) + : 0) && (part = ON_HEADER_LINE))) { /* If it's under/over the scroll bar portion of the mode/header commit 6331d23de3a861de2374be2c03b42e3a2f150792 Author: Mattias Engdegård Date: Wed Oct 9 10:22:10 2019 +0200 Use [^z-a] for matching any character (anychar/anything) in rx * lisp/emacs-lisp/rx.el (rx--translate-symbol): * test/lisp/emacs-lisp/rx-tests.el (rx-any, rx-atoms): Use [^z-a] instead of ".\\|\n" for anychar. The new expression is faster (about 2×) and does not allocate regexp stack space. For example, (0+ anychar) now matches strings of any size (bug#37659). diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index cf02df239f..87b3133b7f 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -136,7 +136,7 @@ Each entry is: ;; Use `list' instead of a quoted list to wrap the strings here, ;; since the return value may be mutated. ((or 'nonl 'not-newline 'any) (cons (list ".") t)) - ((or 'anychar 'anything) (rx--translate-form '(or nonl "\n"))) + ((or 'anychar 'anything) (cons (list "[^z-a]") t)) ('unmatchable (rx--empty)) ((or 'bol 'line-start) (cons (list "^") 'lseq)) ((or 'eol 'line-end) (cons (list "$") 'rseq)) diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el index 903b191c98..ef2541d83a 100644 --- a/test/lisp/emacs-lisp/rx-tests.el +++ b/test/lisp/emacs-lisp/rx-tests.el @@ -126,9 +126,9 @@ (should (equal (rx (not (any "!a" "0-8" digit nonascii))) "[^!0-8a[:digit:][:nonascii:]]")) (should (equal (rx (any) (not (any))) - "\\`a\\`\\(?:.\\|\n\\)")) + "\\`a\\`[^z-a]")) (should (equal (rx (any "") (not (any ""))) - "\\`a\\`\\(?:.\\|\n\\)"))) + "\\`a\\`[^z-a]"))) (ert-deftest rx-pcase () (should (equal (pcase "a 1 2 3 1 1 b" @@ -185,7 +185,7 @@ (ert-deftest rx-atoms () (should (equal (rx anychar anything) - "\\(?:.\\|\n\\)\\(?:.\\|\n\\)")) + "[^z-a][^z-a]")) (should (equal (rx unmatchable) "\\`a\\`")) (should (equal (rx line-start not-newline nonl any line-end) commit ae5407b8579feae17ab34ed9ac68149cc29387c9 Author: Mattias Engdegård Date: Mon Oct 7 18:28:18 2019 +0200 Add `unmatchable' as alias for (or) in rx (bug#37659) * lisp/emacs-lisp/rx.el (rx--translate-symbol, rx--builtin-symbols, rx): * test/lisp/emacs-lisp/rx-tests.el (rx-atoms): * doc/lispref/searching.texi (Rx Constructs): * etc/NEWS: Add `unmatchable', more descriptive than (or), and corresponding to the variable `regexp-unmatchable'. diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 2274bab002..a6c6bf2d4a 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -1083,6 +1083,11 @@ Corresponding string regexp: @samp{@var{A}@var{B}@dots{}} Match exactly one of the @var{rx}s, trying from left to right. Without arguments, the expression will not match anything at all.@* Corresponding string regexp: @samp{@var{A}\|@var{B}\|@dots{}}. + +@item @code{unmatchable} +@cindex @code{unmatchable} in rx +Refuse any match. Equivalent to @code{(or)}. +@xref{regexp-unmatchable}. @end table @subsubheading Repetition @@ -1806,6 +1811,7 @@ list of characters @var{chars}. @c Internal functions: regexp-opt-group +@anchor{regexp-unmatchable} @defvar regexp-unmatchable This variable contains a regexp that is guaranteed not to match any string at all. It is particularly useful as default value for diff --git a/etc/NEWS b/etc/NEWS index 25c1cef951..5794af5b60 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1844,6 +1844,7 @@ the 128...255 range, as expected. matches the empty string, each being an identity for the operation. This also works for their aliases: '|' for 'or'; ':', 'and' and 'sequence' for 'seq'. +The symbol 'unmatchable' can be used as an alternative to (or). --- *** 'regexp' and new 'literal' accept arbitrary lisp as arguments. diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 6c0b206930..cf02df239f 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -126,7 +126,6 @@ Each entry is: (get name 'rx-definition))) ;; TODO: Additions to consider: -;; - A name for (or), maybe `unmatchable'. ;; - A construct like `or' but without the match order guarantee, ;; maybe `unordered-or'. Useful for composition or generation of ;; alternatives; permits more effective use of regexp-opt. @@ -138,6 +137,7 @@ Each entry is: ;; since the return value may be mutated. ((or 'nonl 'not-newline 'any) (cons (list ".") t)) ((or 'anychar 'anything) (rx--translate-form '(or nonl "\n"))) + ('unmatchable (rx--empty)) ((or 'bol 'line-start) (cons (list "^") 'lseq)) ((or 'eol 'line-end) (cons (list "$") 'rseq)) ((or 'bos 'string-start 'bot 'buffer-start) (cons (list "\\`") t)) @@ -912,7 +912,7 @@ can expand to any number of values." "List of built-in rx function-like symbols.") (defconst rx--builtin-symbols - (append '(nonl not-newline any anychar anything + (append '(nonl not-newline any anychar anything unmatchable bol eol line-start line-end bos eos string-start string-end bow eow word-start word-end @@ -1016,6 +1016,7 @@ CHAR Match a literal character. or a character class. not-newline Match any character except a newline. Alias: nonl. anychar Match any character. Alias: anything. +unmatchable Never match anything at all. CHARCLASS Match a character from a character class. One of: alpha, alphabetic, letter Alphabetic characters (defined by Unicode). diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el index d4524e5a25..903b191c98 100644 --- a/test/lisp/emacs-lisp/rx-tests.el +++ b/test/lisp/emacs-lisp/rx-tests.el @@ -186,6 +186,8 @@ (ert-deftest rx-atoms () (should (equal (rx anychar anything) "\\(?:.\\|\n\\)\\(?:.\\|\n\\)")) + (should (equal (rx unmatchable) + "\\`a\\`")) (should (equal (rx line-start not-newline nonl any line-end) "^...$")) (should (equal (rx bol string-start string-end buffer-start buffer-end commit e5a446b0a706ddd4bedf973baeaf54f105198b09 Author: Mattias Engdegård Date: Mon Oct 7 18:07:16 2019 +0200 Add `anychar' as alias to `anything' in rx (bug#37659) * lisp/emacs-lisp/rx.el (rx--translate-symbol, rx--builtin-symbols, rx): * test/lisp/emacs-lisp/rx-tests.el (rx-atoms): * doc/lispref/searching.texi (Rx Constructs): * etc/NEWS: Add `anychar', an alias for `anything'. Since `anychar' is more descriptive (and slightly shorter), treat it as the preferred name. diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index a4b6533412..2274bab002 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -1220,7 +1220,8 @@ Corresponding string regexp: @samp{[^@dots{}]}, @samp{\S@var{code}}, Match any character except a newline.@* Corresponding string regexp: @samp{.} (dot) -@item @code{anything} +@item @code{anychar}, @code{anything} +@cindex @code{anychar} in rx @cindex @code{anything} in rx Match any character.@* Corresponding string regexp: @samp{.\|\n} (for example) diff --git a/etc/NEWS b/etc/NEWS index e1eb74f86e..25c1cef951 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1854,6 +1854,10 @@ at run time, instead of a constant string. *** New rx extension mechanism: 'rx-define', 'rx-let', 'rx-let-eval'. These macros add new forms to the rx notation. ++++ +*** 'anychar' is now an alias for 'anything' +Both match any single character; 'anychar' is more descriptive. + ** Frames +++ diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 45fec796cc..6c0b206930 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -126,7 +126,6 @@ Each entry is: (get name 'rx-definition))) ;; TODO: Additions to consider: -;; - A better name for `anything', like `any-char' or `anychar'. ;; - A name for (or), maybe `unmatchable'. ;; - A construct like `or' but without the match order guarantee, ;; maybe `unordered-or'. Useful for composition or generation of @@ -138,7 +137,7 @@ Each entry is: ;; Use `list' instead of a quoted list to wrap the strings here, ;; since the return value may be mutated. ((or 'nonl 'not-newline 'any) (cons (list ".") t)) - ('anything (rx--translate-form '(or nonl "\n"))) + ((or 'anychar 'anything) (rx--translate-form '(or nonl "\n"))) ((or 'bol 'line-start) (cons (list "^") 'lseq)) ((or 'eol 'line-end) (cons (list "$") 'rseq)) ((or 'bos 'string-start 'bot 'buffer-start) (cons (list "\\`") t)) @@ -913,7 +912,7 @@ can expand to any number of values." "List of built-in rx function-like symbols.") (defconst rx--builtin-symbols - (append '(nonl not-newline any anything + (append '(nonl not-newline any anychar anything bol eol line-start line-end bos eos string-start string-end bow eow word-start word-end @@ -1016,7 +1015,7 @@ CHAR Match a literal character. can be (any ...), (syntax ...), (category ...), or a character class. not-newline Match any character except a newline. Alias: nonl. -anything Match any character. +anychar Match any character. Alias: anything. CHARCLASS Match a character from a character class. One of: alpha, alphabetic, letter Alphabetic characters (defined by Unicode). diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el index 76dcf41942..d4524e5a25 100644 --- a/test/lisp/emacs-lisp/rx-tests.el +++ b/test/lisp/emacs-lisp/rx-tests.el @@ -184,8 +184,8 @@ "ab"))) (ert-deftest rx-atoms () - (should (equal (rx anything) - ".\\|\n")) + (should (equal (rx anychar anything) + "\\(?:.\\|\n\\)\\(?:.\\|\n\\)")) (should (equal (rx line-start not-newline nonl any line-end) "^...$")) (should (equal (rx bol string-start string-end buffer-start buffer-end