commit 5b5403289888efe8783ae6a405845b925f544ec1 (HEAD, refs/remotes/origin/master) Author: Anders Lindgren Date: Tue Apr 26 20:58:52 2016 +0200 Fix bug#22891: wrong terminal width when a fringe width is zero. When either fringe width is zero, Emacs reserved one column for a continuation glyph. Terminal windows does not take this into account when the frame is resized. * lisp/window.el (window-adjust-process-window-size): Use `window-max-chars-per-line' instead of `window-body-width'. * lisp/term.el (term-window-width): Remove function. (It does the same as `window-max-chars-per-line' but without recent bug fixes.) (term-mode): Use `window-max-chars-per-line' instead of `term-window-width'. diff --git a/lisp/term.el b/lisp/term.el index 2d5d3e9..28be8c8 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -919,19 +919,6 @@ is buffer-local." (term-set-escape-char (or term-escape-char ?\C-c)) -(defvar overflow-newline-into-fringe) - -(defun term-window-width () - (if (and (not (featurep 'xemacs)) - (display-graphic-p) - overflow-newline-into-fringe - ;; Subtract 1 from the width when any fringe has zero width, - ;; not just the right fringe. Bug#18601. - (/= (frame-parameter nil 'left-fringe) 0) - (/= (frame-parameter nil 'right-fringe) 0)) - (window-body-width) - (1- (window-body-width)))) - (put 'term-mode 'mode-class 'special) @@ -1018,7 +1005,7 @@ Entry to this mode runs the hooks on `term-mode-hook'." (setq buffer-display-table term-display-table) (set (make-local-variable 'term-home-marker) (copy-marker 0)) (set (make-local-variable 'term-height) (1- (window-height))) - (set (make-local-variable 'term-width) (term-window-width)) + (set (make-local-variable 'term-width) (window-max-chars-per-line)) (set (make-local-variable 'term-last-input-start) (make-marker)) (set (make-local-variable 'term-last-input-end) (make-marker)) (set (make-local-variable 'term-last-input-match) "") diff --git a/lisp/window.el b/lisp/window.el index e086efb..9f63e86 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8560,10 +8560,10 @@ WINDOWS is a list of windows associated with PROCESS. REDUCER is a two-argument function used to combine the widths and heights of the given windows." (when windows - (let ((width (window-body-width (car windows))) + (let ((width (window-max-chars-per-line (car windows))) (height (window-body-height (car windows)))) (dolist (window (cdr windows)) - (setf width (funcall reducer width (window-body-width window))) + (setf width (funcall reducer width (window-max-chars-per-line window))) (setf height (funcall reducer height (window-body-height window)))) (cons width height)))) commit 07d729130e5774fc484ba324d9149d4c6f008260 Author: Simen Heggestøyl Date: Tue Apr 26 20:37:56 2016 +0200 Add completion of `calc()' in CSS mode * lisp/textmodes/css-mode.el (css-value-class-alist): Add `calc()' as a completion candidate for several value classes. (css--value-class-lookup): Return only unique results. * test/lisp/textmodes/css-mode-tests.el (css-test-property-values-no-duplicates) (css-test-value-class-lookup): Update to reflect the above changes. diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 608462b..e30fb3e 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -454,6 +454,7 @@ further value candidates, since that list would be infinite.") "xx-small" "x-small" "small" "medium" "large" "x-large" "xx-large") (alphavalue number) + (angle "calc()") (attachment "scroll" "fixed" "local") (bg-image image "none") (bg-layer bg-image position repeat-style attachment box) @@ -481,6 +482,7 @@ further value candidates, since that list would be infinite.") (final-bg-layer bg-image position repeat-style attachment box color) (font-variant-css21 "normal" "small-caps") + (frequency "calc()") (generic-family "serif" "sans-serif" "cursive" "fantasy" "monospace") (generic-voice "male" "female" "child") @@ -491,7 +493,8 @@ further value candidates, since that list would be infinite.") "historical-ligatures" "no-historical-ligatures") (image uri image-list element-reference gradient) (image-list "image()") - (length number) + (integer "calc()") + (length "calc()" number) (line-height "normal" number length percentage) (line-style "none" "hidden" "dotted" "dashed" "solid" "double" "groove" @@ -499,6 +502,7 @@ further value candidates, since that list would be infinite.") (line-width length "thin" "medium" "thick") (linear-gradient "linear-gradient()") (margin-width "auto" length percentage) + (number "calc()") (numeric-figure-values "lining-nums" "oldstyle-nums") (numeric-fraction-values "diagonal-fractions" "stacked-fractions") (numeric-spacing-values "proportional-nums" "tabular-nums") @@ -529,6 +533,7 @@ further value candidates, since that list would be infinite.") "step-end" "steps()" "cubic-bezier()") (specific-voice identifier) (target-name string) + (time "calc()") (transform-list "matrix()" "translate()" "translateX()" "translateY()" "scale()" "scaleX()" "scaleY()" "rotate()" "skew()" "skewX()" "skewY()" @@ -546,9 +551,8 @@ a class of values, and that symbols in the CDRs always refer to other entries in this list, not to properties. The following classes have been left out above because they -cannot be completed sensibly: `angle', `element-reference', -`frequency', `id', `identifier', `integer', `number', -`percentage', `string', and `time'.") +cannot be completed sensibly: `element-reference', `id', +`identifier', `percentage', and `string'.") (defcustom css-electric-keys '(?\} ?\;) ;; '() "Self inserting keys which should trigger re-indentation." @@ -780,12 +784,13 @@ cannot be completed sensibly: `angle', `element-reference', "Return a list of value completion candidates for VALUE-CLASS. Completion candidates are looked up in `css-value-class-alist' by the symbol VALUE-CLASS." - (seq-mapcat - (lambda (value) - (if (stringp value) - (list value) - (css--value-class-lookup value))) - (cdr (assq value-class css-value-class-alist)))) + (seq-uniq + (seq-mapcat + (lambda (value) + (if (stringp value) + (list value) + (css--value-class-lookup value))) + (cdr (assq value-class css-value-class-alist))))) (defun css--property-values (property) "Return a list of value completion candidates for PROPERTY. diff --git a/test/lisp/textmodes/css-mode-tests.el b/test/lisp/textmodes/css-mode-tests.el index 5d5873b..4c0a357 100644 --- a/test/lisp/textmodes/css-mode-tests.el +++ b/test/lisp/textmodes/css-mode-tests.el @@ -72,12 +72,12 @@ ;; removed, it'll contain at least two instances of `auto'. (should (equal (sort (css--property-values "flex") #'string-lessp) - '("auto" "content" "none")))) + '("auto" "calc()" "content" "none")))) (ert-deftest css-test-value-class-lookup () (should (equal (sort (css--value-class-lookup 'position) #'string-lessp) - '("bottom" "center" "left" "right" "top")))) + '("bottom" "calc()" "center" "left" "right" "top")))) (provide 'css-mode-tests) ;;; css-mode-tests.el ends here commit 40a03df45353692f73364e488c962f1a7cf2e8bc Author: Paul Eggert Date: Tue Apr 26 09:12:14 2016 -0700 Fix socketd fd startup bug that I introduced Problem reported by Matthew Leach in: http://lists.gnu.org/archive/html/emacs-devel/2016-04/msg00778.html * src/emacs.c (main): Indicate more clearly the coupling between the --daemon option and init_process_emacs. * src/lisp.h: Adjust to API changes. * src/process.c (set_external_socket_descriptor): Remove, replacing by ... (init_process_emacs): ... passing the socket FD here instead. All uses changed. diff --git a/src/emacs.c b/src/emacs.c index a738bac..a7cbb32 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -971,6 +971,9 @@ main (int argc, char **argv) w32_daemon_event = NULL; #endif + + int sockfd = -1; + if (argmatch (argv, argc, "-daemon", "--daemon", 5, NULL, &skip_args) || argmatch (argv, argc, "-daemon", "--daemon", 5, &dname_arg, &skip_args)) { @@ -1016,7 +1019,7 @@ main (int argc, char **argv) else if (systemd_socket == 1 && (0 < sd_is_socket (SD_LISTEN_FDS_START, AF_UNSPEC, SOCK_STREAM, 1))) - set_external_socket_descriptor (SD_LISTEN_FDS_START); + sockfd = SD_LISTEN_FDS_START; #endif /* HAVE_LIBSYSTEMD */ #ifndef DAEMON_MUST_EXEC @@ -1575,7 +1578,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem /* This can create a thread that may call getenv, so it must follow all calls to putenv and setenv. Also, this sets up add_keyboard_wait_descriptor, which init_display uses. */ - init_process_emacs (); + init_process_emacs (sockfd); init_keyboard (); /* This too must precede init_sys_modes. */ if (!noninteractive) diff --git a/src/lisp.h b/src/lisp.h index c6f8bb8..1fc6130 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4181,10 +4181,9 @@ extern void delete_keyboard_wait_descriptor (int); extern void add_gpm_wait_descriptor (int); extern void delete_gpm_wait_descriptor (int); #endif -extern void init_process_emacs (void); +extern void init_process_emacs (int); extern void syms_of_process (void); extern void setup_process_coding_systems (Lisp_Object); -extern void set_external_socket_descriptor (int); /* Defined in callproc.c. */ #ifndef DOS_NT diff --git a/src/process.c b/src/process.c index a222a5b..0dfe162 100644 --- a/src/process.c +++ b/src/process.c @@ -267,7 +267,10 @@ static int max_process_desc; /* The largest descriptor currently in use for input; -1 if none. */ static int max_input_desc; -/* The descriptor of any socket passed to Emacs; -1 if none. */ +/* Set the external socket descriptor for Emacs to use when + `make-network-process' is called with a non-nil + `:use-external-socket' option. The value should be either -1, or + the file descriptor of a socket that is already bound. */ static int external_sock_fd; /* Indexed by descriptor, gives the process (if any) for that descriptor. */ @@ -7733,24 +7736,14 @@ catch_child_signal (void) } #endif /* subprocesses */ -/* Set the external socket descriptor for Emacs to use when - `make-network-process' is called with a non-nil - `:use-external-socket' option. The fd should have been checked to - ensure it is a valid socket and is already bound. */ -void -set_external_socket_descriptor (int fd) -{ - external_sock_fd = fd; -} - /* This is not called "init_process" because that is the name of a Mach system call, so it would cause problems on Darwin systems. */ void -init_process_emacs (void) +init_process_emacs (int sockfd) { #ifdef subprocesses - register int i; + int i; inhibit_sentinels = 0; @@ -7772,7 +7765,8 @@ init_process_emacs (void) FD_ZERO (&non_keyboard_wait_mask); FD_ZERO (&non_process_wait_mask); FD_ZERO (&write_mask); - max_process_desc = max_input_desc = external_sock_fd = -1; + max_process_desc = max_input_desc = -1; + external_sock_fd = sockfd; memset (fd_callback_info, 0, sizeof (fd_callback_info)); FD_ZERO (&connect_wait_mask);