commit 13f4b518d0bb7cb4536d341a2a2c8d0b76f75f6b (HEAD, refs/remotes/origin/master) Author: Michael Albinus Date: Sun Feb 11 10:26:57 2018 +0100 Fix handling of file notifications in tramp-gvfs.el * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name): Fix docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch): Use consequently "gio monitor". (tramp-gvfs-monitor-process-filter): Rename from `tramp-gvfs-monitor-file-process-filter'. Adapt implementation. * lisp/net/tramp-sh.el (tramp-gio-events): Move this ... * lisp/net/tramp.el (tramp-gio-events): ... here. diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index 5f28756d75..c859ca147e 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -387,7 +387,7 @@ name of a local copy, if any.") (defun tramp-archive-dissect-file-name (name) "Return a `tramp-file-name' structure. The structure consists of the `tramp-archive-method' method, the -hexlified archive name as host, and the localname. The archive +hexified archive name as host, and the localname. The archive name is kept in slot `hop'" (save-match-data (unless (tramp-archive-file-name-p name) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 70ac077a7c..eb3dddcd6c 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1286,9 +1286,10 @@ If FILE-SYSTEM is non-nil, return file system attributes." "Like `file-notify-add-watch' for Tramp files." (setq file-name (expand-file-name file-name)) (with-parsed-tramp-file-name file-name nil - ;; We cannot watch directories, because `gvfs-monitor-dir' is not - ;; supported for gvfs-mounted directories. - (when (file-directory-p file-name) + ;; TODO: We cannot watch directories, because `gio monitor' is not + ;; supported for gvfs-mounted directories. However, + ;; `file-notify-add-watch' uses directories. + (when (or (not (tramp-gvfs-gio-tool-p v)) (file-directory-p file-name)) (tramp-error v 'file-notify-error "Monitoring not supported for `%s'" file-name)) (let* ((default-directory (file-name-directory file-name)) @@ -1303,9 +1304,7 @@ If FILE-SYSTEM is non-nil, return file system attributes." (p (apply 'start-process "gvfs-monitor" (generate-new-buffer " *gvfs-monitor*") - (if (tramp-gvfs-gio-tool-p v) - `("gio" "monitor" ,(tramp-gvfs-url-file-name file-name)) - `("gvfs-monitor-file" (tramp-gvfs-url-file-name file-name)))))) + `("gio" "monitor" ,(tramp-gvfs-url-file-name file-name))))) (if (not (processp p)) (tramp-error v 'file-notify-error "Monitoring not supported for `%s'" file-name) @@ -1316,7 +1315,7 @@ If FILE-SYSTEM is non-nil, return file system attributes." (process-put p 'watch-name localname) (process-put p 'adjust-window-size-function 'ignore) (set-process-query-on-exit-flag p nil) - (set-process-filter p 'tramp-gvfs-monitor-file-process-filter) + (set-process-filter p 'tramp-gvfs-monitor-process-filter) ;; There might be an error if the monitor is not supported. ;; Give the filter a chance to read the output. (tramp-accept-process-output p 1) @@ -1325,45 +1324,58 @@ If FILE-SYSTEM is non-nil, return file system attributes." p 'file-notify-error "Monitoring not supported for `%s'" file-name)) p)))) -(defun tramp-gvfs-monitor-file-process-filter (proc string) +(defun tramp-gvfs-monitor-process-filter (proc string) "Read output from \"gvfs-monitor-file\" and add corresponding \ file-notify events." - (let* ((rest-string (process-get proc 'rest-string)) + (let* ((events (process-get proc 'events)) + (rest-string (process-get proc 'rest-string)) (dd (with-current-buffer (process-buffer proc) default-directory)) (ddu (regexp-quote (tramp-gvfs-url-file-name dd)))) (when rest-string (tramp-message proc 10 "Previous string:\n%s" rest-string)) (tramp-message proc 6 "%S\n%s" proc string) (setq string (concat rest-string string) - ;; Attribute change is returned in unused wording. - string (replace-regexp-in-string - "ATTRIB CHANGED" "ATTRIBUTE_CHANGED" string)) - (when (string-match "Monitoring not supported" string) + ;; Fix action names. + string (replace-regexp-in-string + "attributes changed" "attribute-changed" string) + string (replace-regexp-in-string + "changes done" "changes-done-hint" string) + string (replace-regexp-in-string + "renamed to" "moved" string)) + ;; https://bugs.launchpad.net/bugs/1742946 + (when (string-match "Monitoring not supported\\|No locations given" string) (delete-process proc)) (while (string-match - (concat "^[\n\r]*" - "File Monitor Event:[\n\r]+" - "File = \\([^\n\r]+\\)[\n\r]+" - "Event = \\([^[:blank:]]+\\)[\n\r]+") + (concat "^.+:" + "[[:space:]]\\(.+\\):" + "[[:space:]]" (regexp-opt tramp-gio-events t) + "\\([[:space:]]\\(.+\\)\\)?$") string) + (let ((file (match-string 1 string)) - (action (intern-soft - (replace-regexp-in-string - "_" "-" (downcase (match-string 2 string)))))) + (file1 (match-string 4 string)) + (action (intern-soft (match-string 2 string)))) (setq string (replace-match "" nil nil string)) ;; File names are returned as URL paths. We must convert them. (when (string-match ddu file) (setq file (replace-match dd nil nil file))) (while (string-match "%\\([0-9A-F]\\{2\\}\\)" file) - (setq file - (replace-match - (char-to-string (string-to-number (match-string 1 file) 16)) - nil nil file))) + (setq file (url-unhex-string file))) + (when (string-match ddu (or file1 "")) + (setq file1 (replace-match dd nil nil file1))) + (while (string-match "%\\([0-9A-F]\\{2\\}\\)" (or file1 "")) + (setq file1 (url-unhex-string file1))) + ;; Remove watch when file or directory to be watched is deleted. + (when (and (member action '(moved deleted)) + (string-equal file (process-get proc 'watch-name))) + (delete-process proc)) ;; Usually, we would add an Emacs event now. Unfortunately, ;; `unread-command-events' does not accept several events at ;; once. Therefore, we apply the callback directly. - (tramp-compat-funcall 'file-notify-callback (list proc action file)))) + (when (member action events) + (tramp-compat-funcall + 'file-notify-callback (list proc action file file1))))) ;; Save rest of the string. (when (zerop (length string)) (setq string nil)) @@ -1483,7 +1495,7 @@ file-notify events." (defun tramp-gvfs-url-file-name (filename) "Return FILENAME in URL syntax." - ;; "/" must NOT be hexlified. + ;; "/" must NOT be hexified. (setq filename (tramp-compat-file-name-unquote filename)) (let ((url-unreserved-chars (cons ?/ url-unreserved-chars)) result) @@ -2352,7 +2364,7 @@ They are retrieved from the hal daemon." ;; * (Customizable) unmount when exiting Emacs. See tramp-archive.el. ;; * Host name completion for existing mount points (afp-server, -;; smb-server) or via smb-network. +;; smb-server, google-drive, owncloud) or via smb-network. ;; ;; * Check, how two shares of the same SMB server can be mounted in ;; parallel. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 25c00d180b..ff5d404aaa 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3556,11 +3556,6 @@ Fall back to normal file name handler if no Tramp handler exists." ;; Default file name handlers, we don't care. (t (tramp-run-real-handler operation args))))))) -(defconst tramp-gio-events - '("attribute-changed" "changed" "changes-done-hint" - "created" "deleted" "moved" "pre-unmount" "unmounted") - "List of events \"gio monitor\" could send.") - (defun tramp-sh-handle-file-notify-add-watch (file-name flags _callback) "Like `file-notify-add-watch' for Tramp files." (setq file-name (expand-file-name file-name)) @@ -3665,13 +3660,12 @@ Fall back to normal file name handler if no Tramp handler exists." (when (string-match "Monitoring not supported\\|No locations given" string) (delete-process proc)) - (while - (string-match - (concat "^[^:]+:" - "[[:space:]]\\([^:]+\\):" - "[[:space:]]" (regexp-opt tramp-gio-events t) - "\\([[:space:]]\\([^:]+\\)\\)?$") - string) + (while (string-match + (concat "^[^:]+:" + "[[:space:]]\\([^:]+\\):" + "[[:space:]]" (regexp-opt tramp-gio-events t) + "\\([[:space:]]\\([^:]+\\)\\)?$") + string) (let* ((file (match-string 1 string)) (file1 (match-string 4 string)) @@ -3762,12 +3756,11 @@ file-notify events." (tramp-message proc 6 "%S\n%s" proc string) (dolist (line (split-string string "[\n\r]+" 'omit)) ;; Check, whether there is a problem. - (unless - (string-match - (concat "^[^[:blank:]]+" - "[[:blank:]]+\\([^[:blank:]]+\\)+" - "\\([[:blank:]]+\\([^\n\r]+\\)\\)?") - line) + (unless (string-match + (concat "^[^[:blank:]]+" + "[[:blank:]]+\\([^[:blank:]]+\\)+" + "\\([[:blank:]]+\\([^\n\r]+\\)\\)?") + line) (tramp-error proc 'file-notify-error "%s" line)) (let ((object diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index b2e20000d3..618d026abd 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3623,10 +3623,16 @@ of." ;; only if that agrees with the buffer's record. (t (equal mt '(-1 65535))))))))) +;; This is used in tramp-gvfs.el and tramp-sh.el. +(defconst tramp-gio-events + '("attribute-changed" "changed" "changes-done-hint" + "created" "deleted" "moved" "pre-unmount" "unmounted") + "List of events \"gio monitor\" could send.") + +;; This is the default handler. tramp-gvfs.el and tramp-sh.el have +;; their own one. (defun tramp-handle-file-notify-add-watch (filename _flags _callback) "Like `file-notify-add-watch' for Tramp files." - ;; This is the default handler. tramp-gvfs.el and tramp-sh.el have - ;; their own one. (setq filename (expand-file-name filename)) (with-parsed-tramp-file-name filename nil (tramp-error commit 09465bfa063a62f03ea746685111632a832068b9 Author: Juri Linkov Date: Sat Feb 10 23:55:34 2018 +0200 * lisp/window.el (display-buffer--maybe-at-bottom): New function (bug#30314). (display-buffer--maybe-pop-up-frame) (display-buffer--maybe-pop-up-window): New functions created from display-buffer--maybe-pop-up-frame-or-window. (display-buffer--maybe-pop-up-frame-or-window): Call display-buffer--maybe-pop-up-frame or display-buffer--maybe-pop-up-window. (display-buffer-at-bottom): Fix parens. * lisp/minibuffer.el (minibuffer-completion-help): Use display-buffer--maybe-pop-up-frame instead of let-binding pop-up-windows to nil. * lisp/files.el (hack-local-variables-confirm) (save-buffers-kill-emacs): Use display-buffer--maybe-at-bottom. diff --git a/lisp/files.el b/lisp/files.el index 414eb3f93a..4b67b02c38 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3315,15 +3315,7 @@ n -- to ignore the local variables list.") ;; Display the buffer and read a choice. (save-window-excursion - (pop-to-buffer buf `((display-buffer--maybe-same-window - display-buffer-reuse-window - display-buffer--maybe-pop-up-frame-or-window - display-buffer-at-bottom) - ,(if temp-buffer-resize-mode - '(window-height . resize-temp-buffer-window) - '(window-height . fit-window-to-buffer)) - ,(when temp-buffer-resize-mode - '(preserve-size . (nil . t))))) + (pop-to-buffer buf '(display-buffer--maybe-at-bottom)) (let* ((exit-chars '(?y ?n ?\s ?\C-g ?\C-v)) (prompt (format "Please type %s%s: " (if offer-save "y, n, or !" "y or n") @@ -6929,15 +6921,7 @@ if any returns nil. If `confirm-kill-emacs' is non-nil, calls it." (or (not active) (with-displayed-buffer-window (get-buffer-create "*Process List*") - `((display-buffer--maybe-same-window - display-buffer-reuse-window - display-buffer--maybe-pop-up-frame-or-window - display-buffer-at-bottom) - ,(if temp-buffer-resize-mode - '(window-height . resize-temp-buffer-window) - '(window-height . fit-window-to-buffer)) - ,(when temp-buffer-resize-mode - '(preserve-size . (nil . t)))) + '(display-buffer--maybe-at-bottom) #'(lambda (window _value) (with-selected-window window (unwind-protect diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index ef0d40790c..e3ae2912a8 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1824,12 +1824,7 @@ variables.") ;; window, mark it as softly-dedicated, so bury-buffer in ;; minibuffer-hide-completions will know whether to ;; delete the window or not. - (display-buffer-mark-dedicated 'soft) - ;; Disable `pop-up-windows' temporarily to allow - ;; `display-buffer--maybe-pop-up-frame-or-window' - ;; in the display actions below to pop up a frame - ;; if `pop-up-frames' is non-nil, but not to pop up a window. - (pop-up-windows nil)) + (display-buffer-mark-dedicated 'soft)) (with-displayed-buffer-window "*Completions*" ;; This is a copy of `display-buffer-fallback-action' @@ -1837,7 +1832,7 @@ variables.") ;; with `display-buffer-at-bottom'. `((display-buffer--maybe-same-window display-buffer-reuse-window - display-buffer--maybe-pop-up-frame-or-window + display-buffer--maybe-pop-up-frame ;; Use `display-buffer-below-selected' for inline completions, ;; but not in the minibuffer (e.g. in `eval-expression') ;; for which `display-buffer-at-bottom' is used. diff --git a/lisp/window.el b/lisp/window.el index abd1a68b1f..8c5e441e4b 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -7289,12 +7289,23 @@ text-only terminal), try with `display-buffer-pop-up-frame'. If that cannot be done, and `pop-up-windows' is non-nil, try again with `display-buffer-pop-up-window'." - (or (and (if (eq pop-up-frames 'graphic-only) - (display-graphic-p) - pop-up-frames) - (display-buffer-pop-up-frame buffer alist)) - (and pop-up-windows - (display-buffer-pop-up-window buffer alist)))) + (or (display-buffer--maybe-pop-up-frame buffer alist) + (display-buffer--maybe-pop-up-window buffer alist))) + +(defun display-buffer--maybe-pop-up-frame (buffer alist) + "Try displaying BUFFER based on `pop-up-frames'. +If `pop-up-frames' is non-nil (and not `graphic-only' on a +text-only terminal), try with `display-buffer-pop-up-frame'." + (and (if (eq pop-up-frames 'graphic-only) + (display-graphic-p) + pop-up-frames) + (display-buffer-pop-up-frame buffer alist))) + +(defun display-buffer--maybe-pop-up-window (buffer alist) + "Try displaying BUFFER based on `pop-up-windows'. +If `pop-up-windows' is non-nil, try with `display-buffer-pop-up-window'." + (and pop-up-windows + (display-buffer-pop-up-window buffer alist))) (defun display-buffer-in-child-frame (buffer alist) "Display BUFFER in a child frame. @@ -7360,6 +7371,17 @@ below the selected one, use that window." (window--display-buffer buffer window 'reuse alist display-buffer-mark-dedicated))))) +(defun display-buffer--maybe-at-bottom (buffer alist) + (let ((alist (append alist `(,(if temp-buffer-resize-mode + '(window-height . resize-temp-buffer-window) + '(window-height . fit-window-to-buffer)) + ,(when temp-buffer-resize-mode + '(preserve-size . (nil . t))))))) + (or (display-buffer--maybe-same-window buffer alist) + (display-buffer-reuse-window buffer alist) + (display-buffer--maybe-pop-up-frame buffer alist) + (display-buffer-at-bottom buffer alist)))) + (defun display-buffer-at-bottom (buffer alist) "Try displaying BUFFER in a window at the bottom of the selected frame. This either reuses such a window provided it shows BUFFER @@ -7376,8 +7398,8 @@ selected frame." (setq bottom-window-shows-buffer t) (setq bottom-window window)) ((not bottom-window) - (setq bottom-window window))) - nil nil 'nomini)) + (setq bottom-window window)))) + nil nil 'nomini) (or (and bottom-window-shows-buffer (window--display-buffer buffer bottom-window 'reuse alist display-buffer-mark-dedicated)) commit aaeb101d899a09e18630466c348041a172cd5d91 Author: Juri Linkov Date: Sat Feb 10 23:46:13 2018 +0200 * lisp/comint.el (comint-after-pmark-p): Check if buffer has a live process. Return nil if not. (comint-history-isearch-setup): Don't check if process is live. Always check if shell prompt is empty regardless of the value of comint-history-isearch. (Bug#30187) diff --git a/lisp/comint.el b/lisp/comint.el index b4fbfc86ed..3163afeff4 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1448,17 +1448,18 @@ If nil, Isearch operates on the whole comint buffer." (defun comint-history-isearch-setup () "Set up a comint for using Isearch to search the input history. Intended to be added to `isearch-mode-hook' in `comint-mode'." - (when (and (get-buffer-process (current-buffer)) - (or (eq comint-history-isearch t) - (and (eq comint-history-isearch 'dwim) - ;; Point is at command line. - (comint-after-pmark-p) - ;; Prompt is not empty like in Async Shell Command buffers - (not (eq (save-excursion - (goto-char (comint-line-beginning-position)) - (forward-line 0) - (point)) - (comint-line-beginning-position)))))) + (when (and + ;; Prompt is not empty like in Async Shell Command buffers + ;; or in finished shell buffers + (not (eq (save-excursion + (goto-char (comint-line-beginning-position)) + (forward-line 0) + (point)) + (comint-line-beginning-position))) + (or (eq comint-history-isearch t) + (and (eq comint-history-isearch 'dwim) + ;; Point is at command line. + (comint-after-pmark-p)))) (setq isearch-message-prefix-add "history ") (setq-local isearch-search-fun-function #'comint-history-isearch-search) @@ -2288,8 +2289,10 @@ If this takes us past the end of the current line, don't skip at all." (defun comint-after-pmark-p () "Return t if point is after the process output marker." - (let ((pmark (process-mark (get-buffer-process (current-buffer))))) - (<= (marker-position pmark) (point)))) + (let ((process (get-buffer-process (current-buffer)))) + (when process + (let ((pmark (process-mark process))) + (<= (marker-position pmark) (point)))))) (defun comint-simple-send (proc string) "Default function for sending to PROC input STRING. commit 7f6153d9563cfe7753083996f59eacc9f4c694df Author: Rami Ylimäki Date: Sat Feb 10 13:31:22 2018 +0200 Support standard Terminfo direct mode terminals Latest Terminfo introduces terminal definitions that support direct color mode. The "Co"/"colors" capability is set to 0x1000000 on these terminals and Emacs is already compatible with them. However, if used Terminfo library hasn't been compiled with 32-bit value support, "Co"/"colors" is truncated to 0x7fff. In this case direct color mode support can be detected from the "RGB" capability flag. There are some minor problems if the color count isn't corrected from 0x7fff. First eight standard colors defined in xterm-standard-colors are shown correctly. However, their RGB values match the terminal settings, not the RGB values defined in xterm-standard-colors. Bright versions of these colors are shown incorrectly. They are interpreted as pixels #000008 - #000015, which are very dark shades of blue. * src/term.c (init_tty): Force terminal color count to 0x1000000 if "RGB" capability is present. * src/tparam.h: Define prototype for tigetflag. (Bug#30308) * doc/misc/efaq.texi (Colors on a TTY): Add information about direct mode terminals supported by Terminfo. diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 3e67438ab9..fef9b1051b 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -1496,32 +1496,41 @@ direct color mode is used. The capability strings are expected to take one 24-bit pixel value as argument and transform the pixel to a string that can be used to send 24-bit colors to the terminal. -There aren't yet any standard terminal type definitions that would -support the capabilities, but Emacs can be invoked with a custom -definition as shown below. +Standard terminal definitions don't support these capabilities and +therefore custom definition is needed. @example -$ cat terminfo-24bit.src +$ cat terminfo-custom.src -# Use colon separators. -xterm-24bit|xterm with 24-bit direct color mode, +xterm-emacs|xterm with 24-bit direct color mode for Emacs, use=xterm-256color, - setb24=\E[48:2:%p1%@{65536@}%/%d:%p1%@{256@}%/%@{255@}%&%d:%p1%@{255@}%&%dm, - setf24=\E[38:2:%p1%@{65536@}%/%d:%p1%@{256@}%/%@{255@}%&%d:%p1%@{255@}%&%dm, -# Use semicolon separators. -xterm-24bits|xterm with 24-bit direct color mode, - use=xterm-256color, - setb24=\E[48;2;%p1%@{65536@}%/%d;%p1%@{256@}%/%@{255@}%&%d;%p1%@{255@}%&%dm, - setf24=\E[38;2;%p1%@{65536@}%/%d;%p1%@{256@}%/%@{255@}%&%d;%p1%@{255@}%&%dm, + setb24=\E[48\:2\:\:%p1%@{65536@}%/%d\:%p1%@{256@}%/%@{255@}%&%d\:%p1%@{255@}%&%dm, + setf24=\E[38\:2\:\:%p1%@{65536@}%/%d\:%p1%@{256@}%/%@{255@}%&%d\:%p1%@{255@}%&%dm, + +$ tic -x -o ~/.terminfo terminfo-custom.src + +$ TERM=xterm-emacs emacs -nw +@end example + +Emacs 27.1 and later support Terminfo capability @samp{RGB} for +detecting 24-bit direct color mode. Multiple standard terminal +definitions support this capability. + +@example +$ TERM=xterm-direct infocmp | grep seta[bf] -$ tic -x -o ~/.terminfo terminfo-24bit.src + setab=\E[%?%p1%@{8@}%<%t4%p1%d%e48\:2\:\:%p1%@{65536@}%/%d\:%p1%@{256@}%/%@{255@}%&%d\:%p1%@{255@}%&%d%;m, + setaf=\E[%?%p1%@{8@}%<%t3%p1%d%e38\:2\:\:%p1%@{65536@}%/%d\:%p1%@{256@}%/%@{255@}%&%d\:%p1%@{255@}%&%d%;m, -$ TERM=xterm-24bit emacs -nw +$ TERM=xterm-direct emacs -nw @end example -Currently there's no standard way to determine whether a terminal -supports direct color mode. If such standard arises later on, support -for @samp{setb24} and @samp{setf24} may be removed. +Terminals with @samp{RGB} capability treat pixels #000001 - #000007 as +indexed colors to maintain backward compatibility with applications +that are unaware of direct color mode. Therefore the seven darkest +blue shades may not be available. If this is a problem, you can +always use custom terminal definition with @samp{setb24} and +@samp{setf24}. @node Debugging a customization file @section How do I debug a @file{.emacs} file? diff --git a/src/term.c b/src/term.c index b3707da70a..64a2b7e551 100644 --- a/src/term.c +++ b/src/term.c @@ -4144,10 +4144,10 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\ tty->TN_max_colors = tgetnum ("Co"); #ifdef TERMINFO - /* Non-standard support for 24-bit colors. */ { const char *fg = tigetstr ("setf24"); const char *bg = tigetstr ("setb24"); + /* Non-standard support for 24-bit colors. */ if (fg && bg && fg != (char *) (intptr_t) -1 && bg != (char *) (intptr_t) -1) @@ -4156,6 +4156,14 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\ tty->TS_set_background = bg; tty->TN_max_colors = 16777216; } + /* Standard support for 24-bit colors. */ + else if (tigetflag ("RGB") > 0) + { + /* If the used Terminfo library supports only 16-bit + signed values, tgetnum("Co") and tigetnum("colors") + could return 32767. */ + tty->TN_max_colors = 16777216; + } } #endif diff --git a/src/tparam.h b/src/tparam.h index f8fb9e0869..3a3cb52c17 100644 --- a/src/tparam.h +++ b/src/tparam.h @@ -37,7 +37,8 @@ extern char *BC; extern char *UP; #ifdef TERMINFO -char *tigetstr(const char *); +int tigetflag (const char *); +char *tigetstr (const char *); #endif #endif /* EMACS_TPARAM_H */ commit 6dcfdb1d4b7d8936c6d549ffd3206f50ed61e9cf Author: Eli Zaretskii Date: Sat Feb 10 12:45:53 2018 +0200 Avoid infinite recursion in file_directory_p * src/fileio.c (file_directory_p) [DOS_NT]: Call faccessat on MS-DOS as well, to avoid infinite recursion introduced by last change in this function. diff --git a/src/fileio.c b/src/fileio.c index b0ef3d4e91..52ca8b6297 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2697,7 +2697,7 @@ See `file-symlink-p' to distinguish symlinks. */) bool file_directory_p (Lisp_Object file) { -#ifdef WINDOWSNT +#ifdef DOS_NT /* This is cheaper than 'stat'. */ return faccessat (AT_FDCWD, SSDATA (file), D_OK, AT_EACCESS) == 0; #else