commit 8c81ac97fdd0d1dff7256dace45bdd48324a0963 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Sun Jul 5 23:16:19 2015 -0700 ; Spelling fixes diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 72c05fe..6a2ff63 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -741,7 +741,7 @@ by \"Save Options\" in Custom buffers.") ;; For the radio buttons below we check whether the respective dividers ;; are displayed on the selected frame. This is not fully congruent -;; with `window-divder-mode' but makes the menu entries work also when +;; with `window-divider-mode' but makes the menu entries work also when ;; dividers are displayed by manipulating frame parameters directly. (defvar menu-bar-showhide-window-divider-menu (let ((menu (make-sparse-keymap "Window Divider"))) diff --git a/src/ChangeLog.13 b/src/ChangeLog.13 index 328f798..196bd8e 100644 --- a/src/ChangeLog.13 +++ b/src/ChangeLog.13 @@ -10152,7 +10152,7 @@ (FRAME_TEXT_COLS_TO_PIXEL_WIDTH, FRAME_PIXEL_WIDTH_TO_TEXT_COLS) (FRAME_TEXT_COLS_TO_PIXEL_WIDTH): Rewrite macros. (FRAME_TOTAL_COLS_ARG): Remove macro. - * fringe.c (draw_fringe_bitmap_1): Handle right divder. + * fringe.c (draw_fringe_bitmap_1): Handle right divider. * gtkutil.c (xg_frame_resized, xg_frame_set_char_size) (x_wm_set_size_hint): Handle frame pixel sizes. * indent.c (compute_motion, Fcompute_motion): commit f3400f4ca62ff03071c943bd31ff622eac90332c Author: Fabián Ezequiel Gallina Date: Mon Jul 6 02:34:44 2015 -0300 python.el: Avoid making let-bound defvars buffer local (Bug#18244) * lisp/progmodes/python.el (python-shell--interpreter) (python-shell--interpreter-args): New vars. (inferior-python-mode, python-shell-make-comint): Use them. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 9c5c71d..339f240 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2483,6 +2483,12 @@ With argument MSG show activation/deactivation message." (python-shell-font-lock-turn-off msg)) python-shell-font-lock-enable)) +;; Used to hold user interactive overrides to +;; `python-shell-interpreter' and `python-shell-interpreter-args' that +;; will be made buffer-local by `inferior-python-mode': +(defvar python-shell--interpreter) +(defvar python-shell--interpreter-args) + (define-derived-mode inferior-python-mode comint-mode "Inferior Python" "Major mode for Python inferior process. Runs a Python interpreter as a subprocess of Emacs, with Python @@ -2508,15 +2514,16 @@ initialization of the interpreter via `python-shell-setup-codes' variable. \(Type \\[describe-mode] in the process buffer for a list of commands.)" - (let ((interpreter python-shell-interpreter) - (args python-shell-interpreter-args)) - (when python-shell--parent-buffer - (python-util-clone-local-variables python-shell--parent-buffer)) - ;; Users can override default values for these vars when calling - ;; `run-python'. This ensures new values let-bound in - ;; `python-shell-make-comint' are locally set. - (set (make-local-variable 'python-shell-interpreter) interpreter) - (set (make-local-variable 'python-shell-interpreter-args) args)) + (when python-shell--parent-buffer + (python-util-clone-local-variables python-shell--parent-buffer)) + ;; Users can interactively override default values for + ;; `python-shell-interpreter' and `python-shell-interpreter-args' + ;; when calling `run-python'. This ensures values let-bound in + ;; `python-shell-make-comint' are locally set if needed. + (set (make-local-variable 'python-shell-interpreter) + (or python-shell--interpreter python-shell-interpreter)) + (set (make-local-variable 'python-shell-interpreter-args) + (or python-shell--interpreter-args python-shell-interpreter-args)) (set (make-local-variable 'python-shell--prompt-calculated-input-regexp) nil) (set (make-local-variable 'python-shell--prompt-calculated-output-regexp) nil) (python-shell-prompt-set-calculated-regexps) @@ -2566,13 +2573,13 @@ killed." interpreter nil args)) (python-shell--parent-buffer (current-buffer)) (process (get-buffer-process buffer)) - ;; As the user may have overridden default values for - ;; these vars on `run-python', let-binding them allows - ;; to have the new right values in all setup code - ;; that's is done in `inferior-python-mode', which is - ;; important, especially for prompt detection. - (python-shell-interpreter interpreter) - (python-shell-interpreter-args + ;; Users can override the interpreter and args + ;; interactively when calling `run-python', let-binding + ;; these allows to have the new right values in all + ;; setup code that is done in `inferior-python-mode', + ;; which is important, especially for prompt detection. + (python-shell--interpreter interpreter) + (python-shell--interpreter-args (mapconcat #'identity args " "))) (with-current-buffer buffer (inferior-python-mode)) commit 8867296609b353715f82e3bcca12f1dfe5469622 Author: Fabián Ezequiel Gallina Date: Mon Jul 6 02:02:06 2015 -0300 ; python.el: Replace `eval-when-compile` with `eval-and-compile` diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 0fe1aa9..9c5c71d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -360,7 +360,7 @@ ;;; Python specialized rx -(eval-when-compile +(eval-and-compile (defconst python-rx-constituents `((block-start . ,(rx symbol-start (or "def" "class" "if" "elif" "else" "try" @@ -431,7 +431,7 @@ This variant of `rx' supports common Python named REGEXPS." ;;; Font-lock and syntax -(eval-when-compile +(eval-and-compile (defun python-syntax--context-compiler-macro (form type &optional syntax-ppss) (pcase type (`'comment commit 02dc8dac7e9a7d3482d63d554bc20b579c74f072 Author: Fabián Ezequiel Gallina Date: Mon Jul 6 01:59:02 2015 -0300 python.el: Fixes for IPython 3.x (Bug#20580) * lisp/progmodes/python.el: (python-shell-completion-native-setup): Fix IPython 3.x setup. (python-shell-completion-native-get-completions): Fix timeout logic. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index fbf944f..0fe1aa9 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3171,9 +3171,12 @@ def __PYTHON_EL_native_completion_setup(): if not is_ipython: readline.set_completer(new_completer) else: - # IPython hacks readline such that `readline.set_completer` + # Try both initializations to cope with all IPython versions. + # This works fine for IPython 3.x but not for earlier: + readline.set_completer(new_completer) + # IPython<3 hacks readline such that `readline.set_completer` # won't work. This workaround injects the new completer - # function into the existing instance directly. + # function into the existing instance directly: instance = getattr(completer, 'im_self', completer.__self__) instance.rlcomplete = new_completer if readline.__doc__ and 'libedit' in readline.__doc__: @@ -3304,7 +3307,7 @@ completion." ;; output end marker is found. Output is accepted ;; *very* quickly to keep the shell super-responsive. (while (and (not (re-search-backward "~~~~__dummy_completion__" nil t)) - (< (- current-time (float-time)) + (< (- (float-time) current-time) python-shell-completion-native-output-timeout)) (accept-process-output process 0.01)) (cl-remove-duplicates commit a5e39bfae8fe8950a01e01b1ae1ad864f5f523b4 Author: Fabián Ezequiel Gallina Date: Mon Jul 6 01:03:46 2015 -0300 python.el: Fix mark-defun behavior (Bug#19665) * lisp/progmodes/python.el: (python-mark-defun): New function. * test/automated/python-tests.el (python-mark-defun-1) (python-mark-defun-2, python-mark-defun-3): New tests. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f641880..fbf944f 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -284,6 +284,7 @@ (define-key map [remap backward-sentence] 'python-nav-backward-block) (define-key map [remap forward-sentence] 'python-nav-forward-block) (define-key map [remap backward-up-list] 'python-nav-backward-up-list) + (define-key map [remap mark-defun] 'python-mark-defun) (define-key map "\C-c\C-j" 'imenu) ;; Indent specific (define-key map "\177" 'python-indent-dedent-line-backspace) @@ -1251,6 +1252,21 @@ the line will be re-indented automatically if needed." (python-indent-region dedenter-pos current-pos))))))))) +;;; Mark + +(defun python-mark-defun (&optional allow-extend) + "Put mark at end of this defun, point at beginning. +The defun marked is the one that contains point or follows point. + +Interactively (or with ALLOW-EXTEND non-nil), if this command is +repeated or (in Transient Mark mode) if the mark is active, it +marks the next defun after the ones already marked." + (interactive "p") + (when (python-info-looking-at-beginning-of-defun) + (end-of-line 1)) + (mark-defun allow-extend)) + + ;;; Navigation (defvar python-nav-beginning-of-defun-regexp diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index 4585e7f..2ed0746 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el @@ -1226,6 +1226,158 @@ this is an arbitrarily expected))))) +;;; Mark + +(ert-deftest python-mark-defun-1 () + """Test `python-mark-defun' with point at defun symbol start.""" + (python-tests-with-temp-buffer + " +def foo(x): + return x + +class A: + pass + +class B: + + def __init__(self): + self.b = 'b' + + def fun(self): + return self.b + +class C: + '''docstring''' +" + (let ((expected-mark-beginning-position + (progn + (python-tests-look-at "class A:") + (1- (point)))) + (expected-mark-end-position-1 + (save-excursion + (python-tests-look-at "pass") + (forward-line) + (point))) + (expected-mark-end-position-2 + (save-excursion + (python-tests-look-at "return self.b") + (forward-line) + (point))) + (expected-mark-end-position-3 + (save-excursion + (python-tests-look-at "'''docstring'''") + (forward-line) + (point)))) + ;; Select class A only, with point at bol. + (python-mark-defun 1) + (should (= (point) expected-mark-beginning-position)) + (should (= (marker-position (mark-marker)) + expected-mark-end-position-1)) + ;; expand to class B, start position should remain the same. + (python-mark-defun 1) + (should (= (point) expected-mark-beginning-position)) + (should (= (marker-position (mark-marker)) + expected-mark-end-position-2)) + ;; expand to class C, start position should remain the same. + (python-mark-defun 1) + (should (= (point) expected-mark-beginning-position)) + (should (= (marker-position (mark-marker)) + expected-mark-end-position-3))))) + +(ert-deftest python-mark-defun-2 () + """Test `python-mark-defun' with point at nested defun symbol start.""" + (python-tests-with-temp-buffer + " +def foo(x): + return x + +class A: + pass + +class B: + + def __init__(self): + self.b = 'b' + + def fun(self): + return self.b + +class C: + '''docstring''' +" + (let ((expected-mark-beginning-position + (progn + (python-tests-look-at "def __init__(self):") + (1- (line-beginning-position)))) + (expected-mark-end-position-1 + (save-excursion + (python-tests-look-at "self.b = 'b'") + (forward-line) + (point))) + (expected-mark-end-position-2 + (save-excursion + (python-tests-look-at "return self.b") + (forward-line) + (point))) + (expected-mark-end-position-3 + (save-excursion + (python-tests-look-at "'''docstring'''") + (forward-line) + (point)))) + ;; Select B.__init only, with point at its start. + (python-mark-defun 1) + (should (= (point) expected-mark-beginning-position)) + (should (= (marker-position (mark-marker)) + expected-mark-end-position-1)) + ;; expand to B.fun, start position should remain the same. + (python-mark-defun 1) + (should (= (point) expected-mark-beginning-position)) + (should (= (marker-position (mark-marker)) + expected-mark-end-position-2)) + ;; expand to class C, start position should remain the same. + (python-mark-defun 1) + (should (= (point) expected-mark-beginning-position)) + (should (= (marker-position (mark-marker)) + expected-mark-end-position-3))))) + +(ert-deftest python-mark-defun-3 () + """Test `python-mark-defun' with point inside defun symbol.""" + (python-tests-with-temp-buffer + " +def foo(x): + return x + +class A: + pass + +class B: + + def __init__(self): + self.b = 'b' + + def fun(self): + return self.b + +class C: + '''docstring''' +" + (let ((expected-mark-beginning-position + (progn + (python-tests-look-at "def fun(self):") + (python-tests-look-at "(self):") + (1- (line-beginning-position)))) + (expected-mark-end-position + (save-excursion + (python-tests-look-at "return self.b") + (forward-line) + (point)))) + ;; Should select B.fun, despite point is inside the defun symbol. + (python-mark-defun 1) + (should (= (point) expected-mark-beginning-position)) + (should (= (marker-position (mark-marker)) + expected-mark-end-position))))) + + ;;; Navigation (ert-deftest python-nav-beginning-of-defun-1 () commit 342ed936e1957c0af32b96d6dee13fa0c84452c1 Author: Glenn Morris Date: Sun Jul 5 19:25:04 2015 -0700 * lisp/progmodes/f90.el (f90-type-def-re): Handle attribute lists such as "extends(parent), private". (Bug#20969) * test/automated/f90.el (f90-test-bug20969, f90-test-bug20969b): New tests. diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index 2bd7e7c..43b057b 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -898,12 +898,12 @@ Can be overridden by the value of `font-lock-maximum-decoration'.") (defconst f90-type-def-re ;; type word ;; type :: word - ;; type, stuff :: word - ;; type, bind(c) :: word - ;; type, extends(stuff) :: word + ;; type, attr-list :: word + ;; where attr-list = attr [, attr ...] + ;; and attr may include bind(c) or extends(thing) ;; NOT "type (" "\\_<\\(type\\)\\_>\\(?:\\(?:[^()\n]*\\|\ -.*,[ \t]*\\(?:bind\\|extends\\)[ \t]*(.*)[ \t]*\\)::\\)?\ +.*,[ \t]*\\(?:bind\\|extends\\)[ \t]*(.*).*\\)::\\)?\ [ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)" "Regexp matching the definition of a derived type.") diff --git a/test/automated/f90.el b/test/automated/f90.el index 4c1abc3..c521d28 100644 --- a/test/automated/f90.el +++ b/test/automated/f90.el @@ -214,4 +214,30 @@ end module modname") (forward-line -1) (should (= 2 (current-indentation))))) +(ert-deftest f90-test-bug20969 () + "Test for http://debbugs.gnu.org/20969 ." + (with-temp-buffer + (f90-mode) + (insert "module modname +type, extends ( sometype ), private :: type1 +integer :: part1 +end type type1 +end module modname") + (f90-indent-subprogram) + (forward-line -1) + (should (= 2 (current-indentation))))) + +(ert-deftest f90-test-bug20969b () + "Test for http://debbugs.gnu.org/20969 ." + (with-temp-buffer + (f90-mode) + (insert "module modname +type, private, extends ( sometype ) :: type1 +integer :: part1 +end type type1 +end module modname") + (f90-indent-subprogram) + (forward-line -1) + (should (= 2 (current-indentation))))) + ;;; f90.el ends here commit ad23626030f0541e761f683661b51152128fb0b5 Author: Paul Eggert Date: Sun Jul 5 19:19:13 2015 -0700 Avoid duplicate calls to current_timespec * src/process.c (wait_reading_process_output): Cache current_timespec results as long as we're not waiting. diff --git a/src/process.c b/src/process.c index 8a8dad7..9d8fa22 100644 --- a/src/process.c +++ b/src/process.c @@ -4591,6 +4591,9 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, int got_some_output = -1; ptrdiff_t count = SPECPDL_INDEX (); + /* Close to the current time if known, an invalid timespec otherwise. */ + struct timespec now = invalid_timespec (); + FD_ZERO (&Available); FD_ZERO (&Writeok); @@ -4611,8 +4614,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, else if (time_limit > 0 || nsecs > 0) { wait = TIMEOUT; - end_time = timespec_add (current_timespec (), - make_timespec (time_limit, nsecs)); + now = current_timespec (); + end_time = timespec_add (now, make_timespec (time_limit, nsecs)); } else wait = INFINITY; @@ -4637,7 +4640,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, /* Exit if already run out. */ if (wait == TIMEOUT) { - struct timespec now = current_timespec (); + if (!timespec_valid_p (now)) + now = current_timespec (); if (timespec_cmp (end_time, now) <= 0) break; timeout = timespec_sub (end_time, now); @@ -4830,7 +4834,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, } else { - /* Set the timeout for adaptive read buffering if any process has non-zero read_output_skip and non-zero read_output_delay, and we are not reading output for a @@ -4876,17 +4879,21 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, && timespec_valid_p (timer_delay) && timespec_cmp (timer_delay, timeout) < 0) { - struct timespec timeout_abs = timespec_add (current_timespec (), - timeout); + if (!timespec_valid_p (now)) + now = current_timespec (); + struct timespec timeout_abs = timespec_add (now, timeout); if (!timespec_valid_p (got_output_end_time) - || timespec_cmp (timeout_abs, - got_output_end_time) < 0) + || timespec_cmp (timeout_abs, got_output_end_time) < 0) got_output_end_time = timeout_abs; timeout = timer_delay; } else got_output_end_time = invalid_timespec (); + /* NOW can become inaccurate if time can pass during pselect. */ + if (timeout.tv_sec > 0 || timeout.tv_nsec > 0) + now = invalid_timespec (); + #if defined (HAVE_NS) nfds = ns_select #elif defined (HAVE_GLIB) @@ -4965,14 +4972,21 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, haven't lowered our timeout due to timers or SIGIO and have waited a long amount of time due to repeated timers. */ - struct timespec now = current_timespec (); - if (wait < TIMEOUT - || (wait == TIMEOUT && timespec_cmp (end_time, now) <= 0) - || (!process_skipped && got_some_output > 0 - && (!timespec_valid_p (got_output_end_time) - || timespec_cmp (got_output_end_time, now) <= 0) - && (timeout.tv_sec > 0 || timeout.tv_nsec > 0))) + if (wait < TIMEOUT) break; + struct timespec cmp_time + = (wait == TIMEOUT + ? end_time + : (!process_skipped && got_some_output > 0 + && (timeout.tv_sec > 0 || timeout.tv_nsec > 0)) + ? got_output_end_time + : invalid_timespec ()); + if (timespec_valid_p (cmp_time)) + { + now = current_timespec (); + if (timespec_cmp (cmp_time, now) <= 0) + break; + } } if (nfds < 0) commit f469c17b9c869b400b3515535b2f1fd9dd00f9a0 Author: Ian Kelling Date: Sun Jul 5 18:14:25 2015 -0700 Avoid returning early reading process output due to SIGIO * src/process.c (wait_reading_process_output): Extend the behavior of not breaking due to not finding output when a timer has lowered the timeout to include when SIGIO lowers the timeout. diff --git a/src/process.c b/src/process.c index 8e046a6..8a8dad7 100644 --- a/src/process.c +++ b/src/process.c @@ -4960,12 +4960,18 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, if (nfds == 0) { + /* Exit the main loop if we've passed the requested timeout, + or aren't skipping processes and got some output and + haven't lowered our timeout due to timers or SIGIO and + have waited a long amount of time due to repeated + timers. */ struct timespec now = current_timespec (); - if ((timeout.tv_sec == 0 && timeout.tv_nsec == 0) + if (wait < TIMEOUT || (wait == TIMEOUT && timespec_cmp (end_time, now) <= 0) || (!process_skipped && got_some_output > 0 && (!timespec_valid_p (got_output_end_time) - || timespec_cmp (got_output_end_time, now) <= 0))) + || timespec_cmp (got_output_end_time, now) <= 0) + && (timeout.tv_sec > 0 || timeout.tv_nsec > 0))) break; } commit 12a2691fb254db20607b2067a12b795a6d7c6649 Author: Ian Kelling Date: Sun Jul 5 17:00:26 2015 -0700 Don't return as fast reading any process output * src/process.c (wait_reading_process_output): The patch for Bug#17647 returns too fast sometimes when reading from any processes. Revert part of it, and limit the timeout more sensibly (Bug#20978). diff --git a/src/process.c b/src/process.c index 325c069..8e046a6 100644 --- a/src/process.c +++ b/src/process.c @@ -4585,7 +4585,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, bool no_avail; int xerrno; Lisp_Object proc; - struct timespec timeout, end_time; + struct timespec timeout, end_time, timer_delay; + struct timespec got_output_end_time = invalid_timespec (); enum { MINIMUM = -1, TIMEOUT, INFINITY } wait; int got_some_output = -1; ptrdiff_t count = SPECPDL_INDEX (); @@ -4618,7 +4619,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, while (1) { - bool timeout_reduced_for_timers = false; + bool process_skipped = false; /* If calling from keyboard input, do not quit since we want to return C-g as an input character. @@ -4632,10 +4633,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell))) break; - /* After reading input, vacuum up any leftovers without waiting. */ - if (0 <= got_some_output) - wait = MINIMUM; - /* Compute time from now till when time limit is up. */ /* Exit if already run out. */ if (wait == TIMEOUT) @@ -4655,8 +4652,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, if (NILP (wait_for_cell) && just_wait_proc >= 0) { - struct timespec timer_delay; - do { unsigned old_timers_run = timers_run; @@ -4687,19 +4682,9 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, && requeued_events_pending_p ()) break; - if (timespec_valid_p (timer_delay)) - { - if (timespec_cmp (timer_delay, timeout) < 0) - { - timeout = timer_delay; - timeout_reduced_for_timers = true; - } - } - else - { - /* This is so a breakpoint can be put here. */ + /* This is so a breakpoint can be put here. */ + if (!timespec_valid_p (timer_delay)) wait_reading_process_output_1 (); - } } /* Cause C-g and alarm signals to take immediate action, @@ -4869,6 +4854,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, if (!XPROCESS (proc)->read_output_skip) continue; FD_CLR (channel, &Available); + process_skipped = true; XPROCESS (proc)->read_output_skip = 0; if (XPROCESS (proc)->read_output_delay < adaptive_nsecs) adaptive_nsecs = XPROCESS (proc)->read_output_delay; @@ -4878,6 +4864,29 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, process_output_skip = 0; } + /* If we've got some output and haven't limited our timeout + with adaptive read buffering, limit it. */ + if (got_some_output > 0 && !process_skipped + && (timeout.tv_sec + || timeout.tv_nsec > READ_OUTPUT_DELAY_INCREMENT)) + timeout = make_timespec (0, READ_OUTPUT_DELAY_INCREMENT); + + + if (NILP (wait_for_cell) && just_wait_proc >= 0 + && timespec_valid_p (timer_delay) + && timespec_cmp (timer_delay, timeout) < 0) + { + struct timespec timeout_abs = timespec_add (current_timespec (), + timeout); + if (!timespec_valid_p (got_output_end_time) + || timespec_cmp (timeout_abs, + got_output_end_time) < 0) + got_output_end_time = timeout_abs; + timeout = timer_delay; + } + else + got_output_end_time = invalid_timespec (); + #if defined (HAVE_NS) nfds = ns_select #elif defined (HAVE_GLIB) @@ -4949,9 +4958,17 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, /* If we woke up due to SIGWINCH, actually change size now. */ do_pending_window_change (0); - if (wait < INFINITY && nfds == 0 && ! timeout_reduced_for_timers) - /* We waited the full specified time, so return now. */ - break; + if (nfds == 0) + { + struct timespec now = current_timespec (); + if ((timeout.tv_sec == 0 && timeout.tv_nsec == 0) + || (wait == TIMEOUT && timespec_cmp (end_time, now) <= 0) + || (!process_skipped && got_some_output > 0 + && (!timespec_valid_p (got_output_end_time) + || timespec_cmp (got_output_end_time, now) <= 0))) + break; + } + if (nfds < 0) { if (xerrno == EINTR) @@ -5079,6 +5096,9 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, got_some_output = nread; if (nread > 0) { + /* Vacuum up any leftovers without waiting. */ + if (wait_proc == XPROCESS (proc)) + wait = MINIMUM; /* Since read_process_output can run a filter, which can call accept-process-output, don't try to read from any other processes commit 6e2fcc213d4569992009480cf298536407cea4d2 Author: Ian Kelling Date: Sun Jul 5 15:55:19 2015 -0700 Refactor timeouts in wait_reading_process_output * src/process.c (wait_reading_process_output): Simplify timeouts with an enum. Remove a redundant condition. (Bug#20978) diff --git a/src/process.c b/src/process.c index 6b3648e..325c069 100644 --- a/src/process.c +++ b/src/process.c @@ -4586,6 +4586,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, int xerrno; Lisp_Object proc; struct timespec timeout, end_time; + enum { MINIMUM = -1, TIMEOUT, INFINITY } wait; int got_some_output = -1; ptrdiff_t count = SPECPDL_INDEX (); @@ -4601,21 +4602,19 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, waiting_for_user_input_p); waiting_for_user_input_p = read_kbd; - if (time_limit < 0) - { - time_limit = 0; - nsecs = -1; - } - else if (TYPE_MAXIMUM (time_t) < time_limit) + if (TYPE_MAXIMUM (time_t) < time_limit) time_limit = TYPE_MAXIMUM (time_t); - /* Since we may need to wait several times, - compute the absolute time to return at. */ - if (time_limit || nsecs > 0) + if (time_limit < 0 || nsecs < 0) + wait = MINIMUM; + else if (time_limit > 0 || nsecs > 0) { - timeout = make_timespec (time_limit, nsecs); - end_time = timespec_add (current_timespec (), timeout); + wait = TIMEOUT; + end_time = timespec_add (current_timespec (), + make_timespec (time_limit, nsecs)); } + else + wait = INFINITY; while (1) { @@ -4635,19 +4634,11 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, /* After reading input, vacuum up any leftovers without waiting. */ if (0 <= got_some_output) - nsecs = -1; + wait = MINIMUM; /* Compute time from now till when time limit is up. */ /* Exit if already run out. */ - if (nsecs < 0) - { - /* A negative timeout means - gobble output available now - but don't wait at all. */ - - timeout = make_timespec (0, 0); - } - else if (time_limit || nsecs > 0) + if (wait == TIMEOUT) { struct timespec now = current_timespec (); if (timespec_cmp (end_time, now) <= 0) @@ -4655,9 +4646,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, timeout = timespec_sub (end_time, now); } else - { - timeout = make_timespec (100000, 0); - } + timeout = make_timespec (wait < TIMEOUT ? 0 : 100000, 0); /* Normally we run timers here. But not if wait_for_cell; in those cases, @@ -4698,24 +4687,20 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, && requeued_events_pending_p ()) break; - /* A negative timeout means do not wait at all. */ - if (nsecs >= 0) - { - if (timespec_valid_p (timer_delay)) - { - if (timespec_cmp (timer_delay, timeout) < 0) - { - timeout = timer_delay; - timeout_reduced_for_timers = true; - } - } - else - { - /* This is so a breakpoint can be put here. */ - wait_reading_process_output_1 (); - } - } - } + if (timespec_valid_p (timer_delay)) + { + if (timespec_cmp (timer_delay, timeout) < 0) + { + timeout = timer_delay; + timeout_reduced_for_timers = true; + } + } + else + { + /* This is so a breakpoint can be put here. */ + wait_reading_process_output_1 (); + } + } /* Cause C-g and alarm signals to take immediate action, and cause input available signals to zero out timeout. @@ -4964,7 +4949,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, /* If we woke up due to SIGWINCH, actually change size now. */ do_pending_window_change (0); - if ((time_limit || nsecs) && nfds == 0 && ! timeout_reduced_for_timers) + if (wait < INFINITY && nfds == 0 && ! timeout_reduced_for_timers) /* We waited the full specified time, so return now. */ break; if (nfds < 0) @@ -6954,21 +6939,21 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, { register int nfds; struct timespec end_time, timeout; + enum { MINIMUM = -1, TIMEOUT, INFINITY } wait; - if (time_limit < 0) - { - time_limit = 0; - nsecs = -1; - } - else if (TYPE_MAXIMUM (time_t) < time_limit) + if (TYPE_MAXIMUM (time_t) < time_limit) time_limit = TYPE_MAXIMUM (time_t); - /* What does time_limit really mean? */ - if (time_limit || nsecs > 0) + if (time_limit < 0 || nsecs < 0) + wait = MINIMUM; + else if (time_limit > 0 || nsecs > 0) { - timeout = make_timespec (time_limit, nsecs); - end_time = timespec_add (current_timespec (), timeout); + wait = TIMEOUT; + end_time = timespec_add (current_timespec (), + make_timespec (time_limit, nsecs)); } + else + wait = INFINITY; /* Turn off periodic alarms (in case they are in use) and then turn off any other atimers, @@ -6994,15 +6979,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, /* Compute time from now till when time limit is up. */ /* Exit if already run out. */ - if (nsecs < 0) - { - /* A negative timeout means - gobble output available now - but don't wait at all. */ - - timeout = make_timespec (0, 0); - } - else if (time_limit || nsecs > 0) + if (wait == TIMEOUT) { struct timespec now = current_timespec (); if (timespec_cmp (end_time, now) <= 0) @@ -7010,9 +6987,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, timeout = timespec_sub (end_time, now); } else - { - timeout = make_timespec (100000, 0); - } + timeout = make_timespec (wait < TIMEOUT ? 0 : 100000, 0); /* If our caller will not immediately handle keyboard events, run timer events directly. @@ -7040,7 +7015,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, && requeued_events_pending_p ()) break; - if (timespec_valid_p (timer_delay) && nsecs >= 0) + if (timespec_valid_p (timer_delay)) { if (timespec_cmp (timer_delay, timeout) < 0) { @@ -7084,7 +7059,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, /* If we woke up due to SIGWINCH, actually change size now. */ do_pending_window_change (0); - if ((time_limit || nsecs) && nfds == 0 && ! timeout_reduced_for_timers) + if (wait < INFINITY && nfds == 0 && ! timeout_reduced_for_timers) /* We waited the full specified time, so return now. */ break; commit 91cbc7b729304302efe7e1d34ac9bb5dc6550f12 Author: Ian Kelling Date: Sun Jul 5 15:38:29 2015 -0700 ; Rename local var nsecs to adaptive_nsecs * src/process.c (wait_reading_process_output): Rename inner nsecs to adaptive_nsecs. There is already an nsecs, and this function is confusing enough (Bug#20978). diff --git a/src/process.c b/src/process.c index 2bac386..6b3648e 100644 --- a/src/process.c +++ b/src/process.c @@ -4868,9 +4868,9 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, Vprocess_adaptive_read_buffering is nil. */ if (process_output_skip && check_delay > 0) { - int nsecs = timeout.tv_nsec; - if (timeout.tv_sec > 0 || nsecs > READ_OUTPUT_DELAY_MAX) - nsecs = READ_OUTPUT_DELAY_MAX; + int adaptive_nsecs = timeout.tv_nsec; + if (timeout.tv_sec > 0 || adaptive_nsecs > READ_OUTPUT_DELAY_MAX) + adaptive_nsecs = READ_OUTPUT_DELAY_MAX; for (channel = 0; check_delay > 0 && channel <= max_process_desc; channel++) { proc = chan_process[channel]; @@ -4885,11 +4885,11 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, continue; FD_CLR (channel, &Available); XPROCESS (proc)->read_output_skip = 0; - if (XPROCESS (proc)->read_output_delay < nsecs) - nsecs = XPROCESS (proc)->read_output_delay; + if (XPROCESS (proc)->read_output_delay < adaptive_nsecs) + adaptive_nsecs = XPROCESS (proc)->read_output_delay; } } - timeout = make_timespec (0, nsecs); + timeout = make_timespec (0, adaptive_nsecs); process_output_skip = 0; } commit 082eda1cbebfc4a71c4b721b38be67aa2de6441e Author: Ian Kelling Date: Sun Jul 5 15:35:23 2015 -0700 ; Rename local var to match function name * src/process.c (wait_reading_process_output, status_notify): Previously the function wait_reading_process_input was renamed to the more logical wait_reading_process_output. Make its local variables consistent with that change (Bug#20978). diff --git a/src/process.c b/src/process.c index 50fa274..2bac386 100644 --- a/src/process.c +++ b/src/process.c @@ -4586,7 +4586,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, int xerrno; Lisp_Object proc; struct timespec timeout, end_time; - int got_some_input = -1; + int got_some_output = -1; ptrdiff_t count = SPECPDL_INDEX (); FD_ZERO (&Available); @@ -4634,7 +4634,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, break; /* After reading input, vacuum up any leftovers without waiting. */ - if (0 <= got_some_input) + if (0 <= got_some_output) nsecs = -1; /* Compute time from now till when time limit is up. */ @@ -4755,7 +4755,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, /* It's okay for us to do this and then continue with the loop, since timeout has already been zeroed out. */ clear_waiting_for_input (); - got_some_input = status_notify (NULL, wait_proc); + got_some_output = status_notify (NULL, wait_proc); if (do_display) redisplay_preserve_echo_area (13); } } @@ -4791,8 +4791,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, } else { - if (got_some_input < nread) - got_some_input = nread; + if (got_some_output < nread) + got_some_output = nread; if (nread == 0) break; read_some_bytes = true; @@ -5089,8 +5089,9 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, buffered-ahead character if we have one. */ nread = read_process_output (proc, channel); - if ((!wait_proc || wait_proc == XPROCESS (proc)) && got_some_input < nread) - got_some_input = nread; + if ((!wait_proc || wait_proc == XPROCESS (proc)) + && got_some_output < nread) + got_some_output = nread; if (nread > 0) { /* Since read_process_output can run a filter, @@ -5250,7 +5251,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, QUIT; } - return got_some_input; + return got_some_output; } /* Given a list (FUNCTION ARGS...), apply FUNCTION to the ARGS. */ @@ -6659,7 +6660,7 @@ status_notify (struct Lisp_Process *deleting_process, Lisp_Object proc; Lisp_Object tail, msg; struct gcpro gcpro1, gcpro2; - int got_some_input = -1; + int got_some_output = -1; tail = Qnil; msg = Qnil; @@ -6693,8 +6694,8 @@ status_notify (struct Lisp_Process *deleting_process, { int nread = read_process_output (proc, p->infd); if ((!wait_proc || wait_proc == XPROCESS (proc)) - && got_some_input < nread) - got_some_input = nread; + && got_some_output < nread) + got_some_output = nread; if (nread <= 0) break; } @@ -6729,7 +6730,7 @@ status_notify (struct Lisp_Process *deleting_process, update_mode_lines = 24; /* In case buffers use %s in mode-line-format. */ UNGCPRO; - return got_some_input; + return got_some_output; } DEFUN ("internal-default-process-sentinel", Finternal_default_process_sentinel, commit 5dc66dbc15ad64b59bcb0943fa16961efc84e822 Author: Ian Kelling Date: Sun Jul 5 15:30:27 2015 -0700 Remove ADAPTIVE_READ_BUFFERING ifdef * src/process.c (make-process, make-pipe-process, deactivate_process) (wait_reading_process_output, read_process_output, send_process) (init_process_emacs): ifdef ADAPTIVE_READ_BUFFERING was originally added in case there was an operating system in which it was not useful. That was 11 years ago and it hasn't happened. Make development easier by not considering the effect of changes on a theoretical OS where this is disabled (Bug#20978). diff --git a/src/process.c b/src/process.c index 9442a9d..50fa274 100644 --- a/src/process.c +++ b/src/process.c @@ -224,11 +224,6 @@ static EMACS_INT update_tick; # define HAVE_SEQPACKET #endif -#if !defined (ADAPTIVE_READ_BUFFERING) && !defined (NO_ADAPTIVE_READ_BUFFERING) -#define ADAPTIVE_READ_BUFFERING -#endif - -#ifdef ADAPTIVE_READ_BUFFERING #define READ_OUTPUT_DELAY_INCREMENT (TIMESPEC_RESOLUTION / 100) #define READ_OUTPUT_DELAY_MAX (READ_OUTPUT_DELAY_INCREMENT * 5) #define READ_OUTPUT_DELAY_MAX_MAX (READ_OUTPUT_DELAY_INCREMENT * 7) @@ -242,10 +237,6 @@ static int process_output_delay_count; static bool process_output_skip; -#else -#define process_output_delay_count 0 -#endif - static void create_process (Lisp_Object, char **, Lisp_Object); #ifdef USABLE_SIGIO static bool keyboard_bit_set (fd_set *); @@ -1517,11 +1508,9 @@ usage: (make-process &rest ARGS) */) pset_gnutls_cred_type (XPROCESS (proc), Qnil); #endif -#ifdef ADAPTIVE_READ_BUFFERING XPROCESS (proc)->adaptive_read_buffering = (NILP (Vprocess_adaptive_read_buffering) ? 0 : EQ (Vprocess_adaptive_read_buffering, Qt) ? 1 : 2); -#endif /* Make the process marker point into the process buffer (if any). */ if (BUFFERP (buffer)) @@ -2184,11 +2173,9 @@ usage: (make-pipe-process &rest ARGS) */) FD_SET (inchannel, &input_wait_mask); FD_SET (inchannel, &non_keyboard_wait_mask); } -#ifdef ADAPTIVE_READ_BUFFERING p->adaptive_read_buffering = (NILP (Vprocess_adaptive_read_buffering) ? 0 : EQ (Vprocess_adaptive_read_buffering, Qt) ? 1 : 2); -#endif /* Make the process marker point into the process buffer (if any). */ if (BUFFERP (buffer)) @@ -4183,7 +4170,6 @@ deactivate_process (Lisp_Object proc) emacs_gnutls_deinit (proc); #endif /* HAVE_GNUTLS */ -#ifdef ADAPTIVE_READ_BUFFERING if (p->read_output_delay > 0) { if (--process_output_delay_count < 0) @@ -4191,7 +4177,6 @@ deactivate_process (Lisp_Object proc) p->read_output_delay = 0; p->read_output_skip = 0; } -#endif /* Beware SIGCHLD hereabouts. */ @@ -4876,7 +4861,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, else { -#ifdef ADAPTIVE_READ_BUFFERING /* Set the timeout for adaptive read buffering if any process has non-zero read_output_skip and non-zero read_output_delay, and we are not reading output for a @@ -4908,7 +4892,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, timeout = make_timespec (0, nsecs); process_output_skip = 0; } -#endif #if defined (HAVE_NS) nfds = ns_select @@ -5345,7 +5328,6 @@ read_process_output (Lisp_Object proc, int channel) #endif nbytes = emacs_read (channel, chars + carryover + buffered, readmax - buffered); -#ifdef ADAPTIVE_READ_BUFFERING if (nbytes > 0 && p->adaptive_read_buffering) { int delay = p->read_output_delay; @@ -5371,7 +5353,6 @@ read_process_output (Lisp_Object proc, int channel) process_output_skip = 1; } } -#endif nbytes += buffered; nbytes += buffered && nbytes <= 0; } @@ -5840,7 +5821,6 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len, #endif written = emacs_write_sig (outfd, cur_buf, cur_len); rv = (written ? 0 : -1); -#ifdef ADAPTIVE_READ_BUFFERING if (p->read_output_delay > 0 && p->adaptive_read_buffering == 1) { @@ -5848,7 +5828,6 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len, process_output_delay_count--; p->read_output_skip = 0; } -#endif } if (rv < 0) @@ -7470,10 +7449,8 @@ init_process_emacs (void) num_pending_connects = 0; #endif -#ifdef ADAPTIVE_READ_BUFFERING process_output_delay_count = 0; process_output_skip = 0; -#endif /* Don't do this, it caused infinite select loops. The display method should call add_keyboard_wait_descriptor on stdin if it @@ -7638,7 +7615,6 @@ then a pipe is used in any case. The value takes effect when `start-process' is called. */); Vprocess_connection_type = Qt; -#ifdef ADAPTIVE_READ_BUFFERING DEFVAR_LISP ("process-adaptive-read-buffering", Vprocess_adaptive_read_buffering, doc: /* If non-nil, improve receive buffering by delaying after short reads. On some systems, when Emacs reads the output from a subprocess, the output data @@ -7650,7 +7626,6 @@ If the value is t, the delay is reset after each write to the process; any other non-nil value means that the delay is not reset on write. The variable takes effect when `start-process' is called. */); Vprocess_adaptive_read_buffering = Qt; -#endif defsubr (&Sprocessp); defsubr (&Sget_process); commit 08150826ae9e2e909d1f5aae8d4bdb4cd205b437 Author: Ian Kelling Date: Sun Jul 5 15:23:35 2015 -0700 ; Minor cleanup of wait_reading_process_output * src/process.c (wait_reading_process_output): Simplify logic. Fix DOS version comments (Bug#20978). diff --git a/src/process.c b/src/process.c index 70c9076..9442a9d 100644 --- a/src/process.c +++ b/src/process.c @@ -4873,8 +4873,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, no_avail = 1; FD_ZERO (&Available); } - - if (!no_avail) + else { #ifdef ADAPTIVE_READ_BUFFERING @@ -6965,9 +6964,7 @@ extern int sys_select (int, fd_set *, fd_set *, fd_set *, DO_DISPLAY means redisplay should be done to show subprocess output that arrives. - Return positive if we received input from WAIT_PROC (or from any - process if WAIT_PROC is null), zero if we attempted to receive - input but got none, and negative if we didn't even try. */ + Return -1 signifying we got no output and did not try. */ int wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, commit 904be8784cfd18cd920668c1d5b3a33353c6bb5b Author: Glenn Morris Date: Sun Jul 5 17:21:42 2015 -0700 * lisp/simple.el (set-variable): Doc fix. diff --git a/lisp/simple.el b/lisp/simple.el index 0729d8c..5ee32d5 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -7314,6 +7314,10 @@ it were the arg to `interactive' (which see) to interactively read VALUE. If VARIABLE has been defined with `defcustom', then the type information in the definition is used to check that VALUE is valid. +Note that this function is at heart equivalent to the basic `set' function. +For a VARIABLE defined with `defcustom', it is not the same as using +\\[customize-variable]. + With a prefix argument, set VARIABLE to VALUE buffer-locally." (interactive (let* ((default-var (variable-at-point)) commit 23818bba0d52ea7513cecfcf7b5a70e67ff050f2 Author: Glenn Morris Date: Sun Jul 5 17:16:01 2015 -0700 * lisp/progmodes/fortran.el (fortran-line-length): Doc fix. diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index c0d4454..65aa745 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -916,12 +916,12 @@ with no args, if that value is non-nil." (defun fortran-line-length (nchars &optional global) "Set the length of fixed-form Fortran lines to NCHARS. -This normally only affects the current buffer, which must be in -Fortran mode. If the optional argument GLOBAL is non-nil, it -affects all Fortran buffers, and also the default. -If a numeric prefix argument is specified, it will be used as NCHARS, -otherwise is a non-numeric prefix arg is specified, the length will be -provided via the minibuffer, and otherwise the current column is used." +By default this only affects the current buffer, which must be in +Fortran mode. If the optional argument GLOBAL is non-nil, it affects +all Fortran buffers, and also the default. The default value of NCHARS +is the current column. A numeric prefix argument specifies a value to +use instead of the current column. A non-numeric prefix argument prompts +for the value to use." (interactive (list (cond ((numberp current-prefix-arg) current-prefix-arg) commit cbeeab2eab5d53f0fba452d4790d7a58071605e2 Author: Ian Kelling Date: Sun Jul 5 15:14:12 2015 -0700 accept-process-output fix This is a followon to the fix for Bug#17647 (Bug#20976). * src/process.c (status_notify): Fix too high return in some cases. diff --git a/src/process.c b/src/process.c index 3132f19..70c9076 100644 --- a/src/process.c +++ b/src/process.c @@ -6714,7 +6714,8 @@ status_notify (struct Lisp_Process *deleting_process, && p != deleting_process) { int nread = read_process_output (proc, p->infd); - if (got_some_input < nread) + if ((!wait_proc || wait_proc == XPROCESS (proc)) + && got_some_input < nread) got_some_input = nread; if (nread <= 0) break; commit 5516728eac58aba87a39427b7a3d1bfb8e2a19d0 Author: Artur Malabarba Date: Sun Jul 5 16:44:22 2015 +0100 * lisp/character-fold.el (character-fold-table): Only fold decompositions if at least one character is non-spacing. (Bug#20975) diff --git a/lisp/character-fold.el b/lisp/character-fold.el index fca13bf..bf5ae59 100644 --- a/lisp/character-fold.el +++ b/lisp/character-fold.el @@ -52,7 +52,9 @@ some).") ;; Skip trivial cases like ?a decomposing to (?a). (unless (or (and (eq i (car dec)) (not (cdr dec)))) - (let ((d dec) k found multiletter) + (let ((d dec) + (fold-decomp t) + k found) (while (and d (not found)) (setq k (pop d)) ;; Is k a number or letter, per unicode standard? @@ -63,20 +65,30 @@ some).") ;; because then we don't want the first letter to match ;; the decomposition. (dolist (k d) - (when (memq (get-char-code-property k 'general-category) - '(Lu Ll Lt Lm Lo Nd Nl No)) - (setq multiletter t))) + (when (and fold-decomp + (memq (get-char-code-property k 'general-category) + '(Lu Ll Lt Lm Lo Nd Nl No))) + (setq fold-decomp nil))) ;; If there's no number or letter on the ;; decomposition, take the first character in it. (setq found (car-safe dec))) + ;; Finally, we only fold multi-char decomposition if at + ;; least one of the chars is non-spacing (combining). + (when fold-decomp + (setq fold-decomp nil) + (dolist (k dec) + (when (and (not fold-decomp) + (> (get-char-code-property k 'canonical-combining-class) 0)) + (setq fold-decomp t)))) ;; Add i to the list of characters that k can ;; represent. Also possibly add its decomposition, so we can ;; match multi-char representations like (format "a%c" 769) (when (and found (not (eq i k))) (let ((chars (cons (char-to-string i) (aref equiv k)))) (aset equiv k - (if multiletter chars - (cons (apply #'string dec) chars))))))))) + (if fold-decomp + (cons (apply #'string dec) chars) + chars)))))))) table) ;; Add some manual entries. commit 1323c13978b7280ddf034e8f527f48d17487b5a2 Author: Paul Eggert Date: Sun Jul 5 08:22:26 2015 -0700 Merge from gnulib This incorporates: 2015-07-04 file-has-acl, acl-permissions: fix HP-UX typos 2015-07-03 set-permissions.c: adjust acl_from_mode's cpp guard 2015-07-02 update-copyright: fix test failure with perl >= 5.22 2015-07-01 gnulib-common.m4: change the ARFLAGS default to 'cr' 2015-07-01 acl: fix definition of acl_from_mode on FreeBSD * build-aux/update-copyright, doc/misc/texinfo.tex, lib/acl-internal.h: * lib/set-permissions.c, m4/gnulib-common.m4: Copy from gnulib. diff --git a/build-aux/update-copyright b/build-aux/update-copyright index 4eb4b93..8cc36e2 100755 --- a/build-aux/update-copyright +++ b/build-aux/update-copyright @@ -124,7 +124,7 @@ use strict; use warnings; my $copyright_re = 'Copyright'; -my $circle_c_re = '(?:\([cC]\)|@copyright{}|\\\\\(co|©)'; +my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|©)'; my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER}; $holder ||= 'Free Software Foundation, Inc.'; my $prefix_max = 5; diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index 6095110..f773c90 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2015-06-14.15} +\def\texinfoversion{2015-07-01.07} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -277,6 +277,7 @@ % described on page 260 of The TeXbook. It involves outputting two % marks for the sectioning macros, one before the section break, and % one after. I won't pretend I can describe this better than DEK... +% \def\domark{% \toks0=\expandafter{\lastchapterdefs}% \toks2=\expandafter{\lastsectiondefs}% @@ -6881,7 +6882,7 @@ end % typesetting commands (@smallbook, font changes, etc.) have to be done % beforehand -- and a) we want @copying to be done first in the source % file; b) letting users define the frontmatter in as flexible order as -% possible is very desirable. +% possible is desirable. % \def\copying{\checkenv{}\begingroup\scanargctxt\docopying} \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} @@ -7449,6 +7450,12 @@ end % % \anythingelse will almost certainly be an error of some kind. +\def\macrolineargctxt{% used for whole-line arguments without braces + \scanctxt + \catcode`\{=\other + \catcode`\}=\other +} + % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N % where N is the macro parameter number. @@ -7522,12 +7529,14 @@ end % This makes use of the obscure feature that if the last token of a % is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. +% \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname#1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} -% For macro processing make @ a letter so that we can make Texinfo private macro names. +% For macro processing make @ a letter so that we can make +% private-to-Texinfo macro names. \edef\texiatcatcode{\the\catcode`\@} \catcode `@=11\relax @@ -7558,6 +7567,7 @@ end % % If you compile with TeX (not eTeX), and you have macros with 10 or more % arguments, no macro can have more than 256 arguments (else error). +% \def\parsemargdef#1;{% \paramno=0\def\paramlist{}% \let\hash\relax @@ -7601,7 +7611,6 @@ end % These two commands read recursive and nonrecursive macro bodies. % (They're different since rec and nonrec macros end differently.) % - \catcode `\@\texiatcatcode \long\def\parsemacbody#1@end macro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% @@ -7637,7 +7646,8 @@ end \fi } -% +% Internal for \getargsval@. +% \def\getargvals@@{% \ifx\paramlist\nilm@ % Some sanity check needed here that \argvaluelist is also empty. @@ -7681,7 +7691,8 @@ end } % Replace arguments by their values in the macro body, and place the result -% in macro \@tempa +% in macro \@tempa. +% \def\macvalstoargs@{% % To do this we use the property that token registers that are \the'ed % within an \edef expand only once. So we are going to place all argument @@ -7705,8 +7716,9 @@ end \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% } +% Define the named-macro outside of this group and then close this group. +% \def\macargexpandinbody@{% - %% Define the named-macro outside of this group and then close this group. \expandafter \endgroup \macargdeflist@ @@ -7743,14 +7755,17 @@ end \next } -% Save the token stack pointer into macro #1 +% Save the token stack pointer into macro #1: \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} -% Restore the token stack pointer from number in macro #1 -\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} -% newtoks that can be used non \outer . +% +% Restore the token stack pointer from number in macro #1: +\def\texirestoretoksstackpoint#1{\expandafter\mathchardef + \expandafter\@cclvi#1\relax} +% Variant \newtoks that can be used non-\outer: \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} -% Tailing missing arguments are set to empty +% Tailing missing arguments are set to empty. +% \def\setemptyargvalues@{% \ifx\paramlist\nilm@ \let\next\macargexpandinbody@ @@ -7795,7 +7810,7 @@ end \noexpand\scanmacro{\temp}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt + \bgroup \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% @@ -7828,7 +7843,7 @@ end \noexpand\scanmacro{\temp}\egroup}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt + \bgroup \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% @@ -7860,19 +7875,20 @@ end \fi \fi} -\catcode `\@\texiatcatcode\relax +\catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} -% \braceorline decides whether the next nonwhitespace character is a -% {. If so it reads up to the closing }, if not, it reads the whole -% line. Whatever was read is then fed to the next control sequence -% as an argument (by \parsebrace or \parsearg). +% \braceorline MAC is used for a one-argument macro MAC. It checks +% whether the next non-whitespace character is a {. It sets the context +% for reading the argument (slightly different in the two cases). Then, +% to read the argument, in the whole-line case, it then calls the +% regular \parsearg MAC; in the lbrace case, it just calls MAC itself. % \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% - \ifx\nchar\bgroup\else - \expandafter\parsearg + \ifx\nchar\bgroup\macroargctxt + \else\macrolineargctxt\expandafter\parsearg \fi \macnamexxx} diff --git a/lib/acl-internal.h b/lib/acl-internal.h index d592a75..4f042ad 100644 --- a/lib/acl-internal.h +++ b/lib/acl-internal.h @@ -127,10 +127,8 @@ rpl_acl_set_fd (int fd, acl_t acl) # define acl_extended_file(name) (-1) # endif -/* Linux-specific */ -# ifndef HAVE_ACL_FROM_MODE -# define HAVE_ACL_FROM_MODE false -# define acl_from_mode(mode) (NULL) +# if ! defined HAVE_ACL_FROM_MODE && ! defined HAVE_ACL_FROM_TEXT +# define acl_from_mode (NULL) # endif /* Set to 0 if a file's mode is stored independently from the ACL. */ diff --git a/lib/set-permissions.c b/lib/set-permissions.c index 3bcfd31..25c463d 100644 --- a/lib/set-permissions.c +++ b/lib/set-permissions.c @@ -25,6 +25,8 @@ #if USE_ACL # if ! defined HAVE_ACL_FROM_MODE && defined HAVE_ACL_FROM_TEXT /* FreeBSD, IRIX, Tru64 */ +# if HAVE_ACL_GET_FILE && !HAVE_ACL_TYPE_EXTENDED + static acl_t acl_from_mode (mode_t mode) { @@ -46,6 +48,7 @@ acl_from_mode (mode_t mode) return acl_from_text (acl_text); } +# endif # endif # if HAVE_FACL && defined GETACL /* Solaris, Cygwin, not HP-UX */ @@ -269,7 +272,7 @@ set_acls_from_mode (const char *name, int desc, mode_t mode, bool *must_chmod) } } -#elif HAVE_GETACL /* HP-UX */ +# elif HAVE_GETACL /* HP-UX */ static int context_acl_from_mode (struct permission_context *ctx, const char *name, int desc) { @@ -285,13 +288,13 @@ context_acl_from_mode (struct permission_context *ctx, const char *name, int des ctx->entries[0].uid = statbuf.st_uid; ctx->entries[0].gid = ACL_NSGROUP; - ctx->entries[0].mode = (mode >> 6) & 7; + ctx->entries[0].mode = (ctx->mode >> 6) & 7; ctx->entries[1].uid = ACL_NSUSER; ctx->entries[1].gid = statbuf.st_gid; - ctx->entries[1].mode = (mode >> 3) & 7; + ctx->entries[1].mode = (ctx->mode >> 3) & 7; ctx->entries[2].uid = ACL_NSUSER; ctx->entries[2].gid = ACL_NSGROUP; - ctx->entries[2].mode = mode & 7; + ctx->entries[2].mode = ctx->mode & 7; ctx->count = 3; return 0; } @@ -304,24 +307,24 @@ context_aclv_from_mode (struct permission_context *ctx) ctx->aclv_entries[0].a_type = USER_OBJ; ctx->aclv_entries[0].a_id = 0; /* irrelevant */ - ctx->aclv_entries[0].a_perm = (mode >> 6) & 7; + ctx->aclv_entries[0].a_perm = (ctx->mode >> 6) & 7; ctx->aclv_entries[1].a_type = GROUP_OBJ; ctx->aclv_entries[1].a_id = 0; /* irrelevant */ - ctx->aclv_entries[1].a_perm = (mode >> 3) & 7; + ctx->aclv_entries[1].a_perm = (ctx->mode >> 3) & 7; ctx->aclv_entries[2].a_type = CLASS_OBJ; ctx->aclv_entries[2].a_id = 0; - ctx->aclv_entries[2].a_perm = (mode >> 3) & 7; + ctx->aclv_entries[2].a_perm = (ctx->mode >> 3) & 7; ctx->aclv_entries[3].a_type = OTHER_OBJ; ctx->aclv_entries[3].a_id = 0; - ctx->aclv_entries[3].a_perm = mode & 7; + ctx->aclv_entries[3].a_perm = ctx->mode & 7; ctx->aclv_count = 4; - ret = aclsort (sizeof (entries) / sizeof (struct acl), 1, entries); + ret = aclsort (ctx->aclv_count, 1, ctx->aclv_entries); if (ret > 0) abort (); return ret; } -#endif +# endif # elif HAVE_ACLX_GET && defined ACL_AIX_WIP /* AIX */ static int @@ -458,19 +461,19 @@ context_acl_from_mode (struct permission_context *ctx) ctx->entries[0].a_type = USER_OBJ; ctx->entries[0].a_id = 0; /* irrelevant */ - ctx->entries[0].a_perm = (mode >> 6) & 7; + ctx->entries[0].a_perm = (ctx->mode >> 6) & 7; ctx->entries[1].a_type = GROUP_OBJ; ctx->entries[1].a_id = 0; /* irrelevant */ - ctx->entries[1].a_perm = (mode >> 3) & 7; + ctx->entries[1].a_perm = (ctx->mode >> 3) & 7; ctx->entries[2].a_type = CLASS_OBJ; ctx->entries[2].a_id = 0; - ctx->entries[2].a_perm = (mode >> 3) & 7; + ctx->entries[2].a_perm = (ctx->mode >> 3) & 7; ctx->entries[3].a_type = OTHER_OBJ; ctx->entries[3].a_id = 0; - ctx->entries[3].a_perm = mode & 7; + ctx->entries[3].a_perm = ctx->mode & 7; ctx->count = 4; - ret = aclsort (sizeof (entries) / sizeof (struct acl), 1, entries); + ret = aclsort (ctx->count, 1, entries); if (ret > 0) abort (); return ret; @@ -483,18 +486,18 @@ set_acls (struct permission_context *ctx, const char *name, int desc, { int ret = 0; -#if HAVE_ACL_GET_FILE +# if HAVE_ACL_GET_FILE /* POSIX 1003.1e (draft 17 -- abandoned) specific version. */ /* Linux, FreeBSD, Mac OS X, IRIX, Tru64 */ # if !HAVE_ACL_TYPE_EXTENDED /* Linux, FreeBSD, IRIX, Tru64 */ -# ifndef HAVE_ACL_FROM_TEXT -# error Must have acl_from_text (see POSIX 1003.1e draft 17). -# endif -# ifndef HAVE_ACL_DELETE_DEF_FILE -# error Must have acl_delete_def_file (see POSIX 1003.1e draft 17). -# endif +# ifndef HAVE_ACL_FROM_TEXT +# error Must have acl_from_text (see POSIX 1003.1e draft 17). +# endif +# ifndef HAVE_ACL_DELETE_DEF_FILE +# error Must have acl_delete_def_file (see POSIX 1003.1e draft 17). +# endif if (! ctx->acls_not_supported) { @@ -641,9 +644,9 @@ set_acls (struct permission_context *ctx, const char *name, int desc, else *acls_set = true; } -# endif +# endif -#elif HAVE_GETACL /* HP-UX */ +# elif HAVE_GETACL /* HP-UX */ if (from_mode) ret = context_acl_from_mode (ctx, name, desc); @@ -657,7 +660,7 @@ set_acls (struct permission_context *ctx, const char *name, int desc, if (ret < 0) { if ((errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP) - && (from_mode || !acl_nontrivial (ctx->count, ctx->entries, &source_statbuf))) + && (from_mode || !acl_nontrivial (ctx->count, ctx->entries))) ret = 0; } else @@ -730,7 +733,7 @@ set_acls (struct permission_context *ctx, const char *name, int desc, /* Nothing to do. */ -#endif +# endif return ret; } @@ -801,10 +804,9 @@ set_permissions (struct permission_context *ctx, const char *name, int desc) int saved_errno = ret ? errno : 0; /* If we can't set an acl which we expect to be able to set, try setting - the permissions to ctx->mode. Doe to possible inherited permissions, + the permissions to ctx->mode. Due to possible inherited permissions, we cannot simply chmod. */ - acls_set = false; ret = set_acls (ctx, name, desc, true, &must_chmod, &acls_set); if (! acls_set) must_chmod = true; diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index b301abe..40e82f6 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -278,12 +278,12 @@ Amsterdam dnl but prefer ${host}-ar over ar (useful for cross-compiling). AC_CHECK_TOOL([AR], [ar], [ar]) if test -z "$ARFLAGS"; then - ARFLAGS='cru' + ARFLAGS='cr' fi fi else if test -z "$ARFLAGS"; then - ARFLAGS='cru' + ARFLAGS='cr' fi fi AC_SUBST([AR]) commit b9e14de6cf08a19fa5d98742b71c5580a50a40d8 Author: Glenn Morris Date: Sun Jul 5 06:24:07 2015 -0400 ; Auto-commit of ChangeLog files. diff --git a/ChangeLog.2 b/ChangeLog.2 index 66c6dd0..9c79d76 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -1,3 +1,381 @@ +2015-07-05 Christoph Wedler + + Respect `prog-indentation-context' in python.el + * lisp/progmodes/python.el (python-indent-guess-indent-offset) + (python-indent-context, python-indent--calculate-indentation) + (python-info-current-defun) + (python-info-dedenter-opening-block-message) + (python-info-line-ends-backslash-p) + (python-info-beginning-of-backslash) + (python-info-continuation-line-p): Use `prog-widen'. + (python-indent--calculate-indentation) + (python-indent--calculate-levels) + (python-indent-calculate-indentation): Use `prog-first-column'. + (python-indent--calculate-levels): Simplify. + Ignore also initial empty lines for syntax calculation. + * lisp/progmodes/python.el (python-indent-context): Return + :no-indent for first non-empty line, not just in line 1. + * test/automated/python-tests.el (python-indent-base-case) + (python-indent-inside-paren-1, python-indent-inside-paren-2) + (python-indent-inside-paren-3, python-indent-inside-paren-4) + (python-indent-inside-paren-5, python-indent-inside-paren-6) + (python-indent-after-backslash-1) + (python-indent-after-backslash-2) + (python-indent-after-backslash-3) + (python-indent-after-backslash-4, python-indent-inside-string-1): + Expect :no-indent for first non-empty line. + +2015-07-04 Daniel Colascione + + Factor isearch word description into new function + * lisp/isearch.el (isearch--describe-word-mode): New function. + (isearch-message-prefix, isearch-query-replace): Use it. + +2015-07-04 Eli Zaretskii + + Fix mouse pointer on w32 when a menu is active + * src/w32fns.c (w32_wnd_proc): Don't change the mouse pointer + shape while a menu is in use. This started happening since we now + send WM_EMACS_SHOWCURSOR messages when the mouse moves. + +2015-07-04 Martin Rudalics + + Fix processing of alpha parameter for Windows tip frames (Bug#17344) + * src/w32fns.c (x_create_tip_frame): Fix processing alpha + parameter. (Bug#17344) + + Have `compilation-set-window' use right window for getting fringes (Bug#20829) + * lisp/progmodes/compile.el (compilation-set-window): Take + `window-fringes' from argument window. (Bug#20829) + +2015-07-03 Glenn Morris + + Update eieio tests for recent eieio-core change. + * test/automated/eieio-test-persist.el (persist-test-save-and-compare): + * test/automated/eieio-tests.el + (eieio-test-32-slot-attribute-override-2): + Replace the deleted eieio--class-v with cl--find-class. + +2015-07-03 Martin Rudalics + + Fix some issues with `window-divider-mode' + * lisp/frame.el (window-divider-default-places): New option. + (window-divider-mode): Remove option. + (window-divider-mode): Make it a "regular" minor mode. + (window-divider-width-valid-p): Drop frame- prefix. + (window-divider-mode-apply): New argument ENABLE. Drop frame- + prefix. Handle `window-divider-default-places'. + (frame--window-divider-mode-set-and-apply): Remove. + (window-divider-default-bottom-width) + (window-divider-default-right-width): Drop :group entries. + * lisp/menu-bar.el (menu-bar-bottom-and-right-window-divider) + (menu-bar-right-window-divider, menu-bar-bottom-window-divider) + (menu-bar-no-window-divider): Set `window-divider-default-places' + and call `window-divider-mode'. + * doc/emacs/frames.texi (Window Dividers): Document + `window-divider-default-places'. + +2015-07-02 Xue Fuqiao + + Add cross references in documentation + * doc/emacs/display.texi (Displaying Boundaries): + * doc/emacs/search.texi (Word Search): Add cross references. + +2015-07-02 Eli Zaretskii + + ;* src/bidi.c (bpa_stack_entry): Update commentary for Unicode 8.0. + +2015-07-02 Paul Eggert + + -batch should not affect ‘’ -> `' display + * lisp/startup.el (command-line): Do the ‘’ -> `' check even if + -batch (Bug#20926). + +2015-07-02 Stefan Monnier + + * lisp/emacs-lisp/eieio-core.el (eieio--class-v): Remove + * lisp/emacs-lisp/eieio-core.el, lisp/emacs-lisp/eieio.el, + lisp/emacs-lisp/eieio-opt.el, lisp/emacs-lisp/eieio-compat.el: + Use cl--find-class instead. + + * lisp/term/xterm.el (xterm--query): Fix paren typo (bug#20951). + +2015-07-02 Martin Rudalics + + Some further fixes in Change Window node. (Bug#20183) + * doc/emacs/windows.texi (Change Window): Replace "rearranging" + by "resizing" in section title. Add some concept indices. + Suggested by N. Jackson (Bug#20183). + + Reference window dividers in Change Window section. + * doc/emacs/windows.texi (Change Window): Reference window + dividers. + + Document new `window-divider-mode'. + * lisp/frame.el (window-divider-mode): Fix doc-string. + * doc/emacs/frames.texi (Window Dividers): New section. + + Improve accessibility of window dividers. (Bug#20183) + * lisp/faces.el (window-divider) + (window-divider-first-pixel, window-divider-last-pixel): Change + membership from `frames' to `window-divider' customization group. + * lisp/frame.el (window-divider): New customization group. + (window-divider-mode): New minor mode. + (window-divider-default-bottom-width) + (window-divider-default-right-width): New options. + (frame--window-divider-previous-mode): New variable. + (frame-window-divider-width-valid-p) + (frame--window-divider-mode-apply) + (frame--window-divider-mode-set-and-apply): New functions. + * lisp/menu-bar.el (menu-bar-options-save): Save + window-divider-mode settings. + (menu-bar-window-divider-customize) + (menu-bar-bottom-and-right-window-divider) + (menu-bar-right-window-divider, menu-bar-bottom-window-divider) + (menu-bar-no-window-divider): New functions. + (menu-bar-showhide-window-divider-menu): New variable. + (menu-bar-showhide-menu): Show/hide window divider menu. + * lisp/mouse.el (mouse-split-window-vertically) + (mouse-split-window-horizontally): Replace `error' by + `user-error'. Bind `window-combination-resize' to nil. + (top-level): Add/reorder mouse key bindings on mode- and + vertical-line. + +2015-07-02 Paul Eggert + + Don't display ‘’ as `' under X in en_GB + The curved quote setup code invokes (char-displayable-p ?‘), + but this isn’t reliable until after the X frame replaces the + terminal frame (Bug#20926). + * lisp/international/mule-cmds.el (set-locale-environment): + Move curved quote setup code from here ... + * lisp/startup.el (command-line): ... to here, after creating + the X frame. + +2015-07-01 Nicolas Richard + + * lisp/emacs-lisp/seq.el (seq-difference): Fix typo in docstring + + Add argument to reverse the meaning of ido-restrict-to-matches + * lisp/ido.el (ido-restrict-to-matches): Add an optional argument + to reverse the meaning (Bug#15631). + +2015-07-01 Eli Zaretskii + + Be more tolerant to fonts named "Foobar-12" + * src/frame.c (x_set_font): If font_spec_from_name returns nil, + don't barf; instead, request a new fontset to be generated. This + avoids unnecessarily rejecting fonts named against XLFD rules. See + http://lists.gnu.org/archive/html/help-emacs-windows/2015-06/msg00001.html, + for the description of the original problem. + * lisp/faces.el (set-face-attribute): Don't be fooled too easily + by a hyphen in a font's name. + + Fix value of posn-at-pont in R2L lines + * src/keyboard.c (Fposn_at_x_y, Fposn_at_point): Allow X pixel + coordinate of -1, for a newline in a right-to-left line that + overflowed into the left fringe. + +2015-07-01 Stefan Monnier + + (cl--copy-slot-descriptor): Copy the `props' alist as well + * lisp/emacs-lisp/cl-preloaded.el (cl--copy-slot-descriptor-1): + Rename from cl--copy-slot-descriptor. + (cl--copy-slot-descriptor): New function. Copy the alist (bug#20914). + +2015-06-30 Stefan Monnier + + * lisp/term/xterm.el (xterm--query): Avoid generating garbage + (xterm-query-timeout): New var. + (xterm--query): Use it. Fallback on async method if we timeout before + getting the first byte of the reply (bug#12354). + +2015-06-30 Paul Eggert + + Spelling fixes + +2015-06-30 Xue Fuqiao + + * doc/emacs/frames.texi (Frame Commands): Typo fix. (Bug#20946) + +2015-06-30 Paul Eggert + + In strings, prefer plain ` and ' to \` and \' + * lisp/allout.el (allout-insert-listified): + * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): + * lisp/ls-lisp.el (ls-lisp-UCA-like-collation) + (ls-lisp-string-lessp): + * lisp/menu-bar.el (menu-bar-open): + * lisp/obsolete/otodo-mode.el (todo-top-priorities): + * lisp/progmodes/compile.el (compile): + * lisp/progmodes/etags.el (tags-loop-scan): + * lisp/progmodes/make-mode.el (makefile-browser-insert-continuation): + * lisp/subr.el (posn-actual-col-row): + * lisp/term/pc-win.el (x-list-fonts): + * lisp/textmodes/texinfmt.el (texinfmt-version): + * lisp/textmodes/texnfo-upd.el (texinfo-master-menu): + * lisp/time.el (display-time-world-list): + * lisp/tmm.el (tmm-menubar): + * src/buffer.c (syms_of_buffer): + * src/fileio.c (syms_of_fileio): + Omit unnecessary and confusing backslash before quote. + * lisp/erc/erc.el (erc-cmd-LASTLOG): + * lisp/progmodes/flymake.el (flymake-fix-file-name): + * lisp/progmodes/vhdl-mode.el (vhdl-in-extended-identifier-p): + Fix string that was intended to escape a backslash and not a quote. + +2015-06-30 Glenn Morris + + * leim/Makefile.in, lisp/Makefile.in: Add missing EXEEXT definition. + + * lisp/Makefile.in (MH_E_SRC, TRAMP_SRC, CAL_SRC): + Replace hard-coded lists with wildcard + filter-out. + + * configure.ac (system-configuration-features): Add X11, NS. + + Improve reproducibility of generated loaddefs file. + * lisp/emacs-lisp/autoload.el (autoload-generate-file-autoloads): + Make the return value the modtime of the input file (if no autoloads). + (update-directory-autoloads): In the "no autoloads" section, + use "most recent modtime" rather than "current time". + +2015-06-30 Artur Malabarba + + * lisp/emacs-lisp/package.el (package--remove-hidden): Fix logic + (Bug#20930) + +2015-06-30 Nicolas Petton + + * doc/lispref/sequences.texi: Add documentation for seq-min and seq-max. + + Add seq-min and seq-max + Bump version number. + * lisp/emacs-lisp/seq.el (seq-min, seq-max): New functions. + * test/automated/seq-tests.el: Add tests for seq-min and seq-max. + +2015-06-30 Eli Zaretskii + + Make sure sleep-for always delays for as long as it's told + * src/dispnew.c (Fsleep_for): Call wait_reading_process_output in + a loop, to ensure we always wait exactly the required amount of + time. (Bug#15990) + +2015-06-30 Paul Eggert + + Fix pointer signedness glitch + * src/font.c (font_load_for_lface): Use SSDATA, not SDATA. + +2015-06-30 Eli Zaretskii + + Don't block changes in mouse pointer inside 'track-mouse' + * etc/NEWS: + * doc/lispref/frames.texi (Mouse Tracking): Document the special + effect of setting 'track-mouse' to 'dragging'. + * lisp/textmodes/artist.el (artist-mouse-draw-continously): + * lisp/ruler-mode.el (ruler-mode-mouse-drag-any-column-iteration): + * lisp/mouse-drag.el (mouse-drag-throw): + * lisp/mouse.el (mouse-drag-line): Set 'track-mouse' to 'dragging' + to avoid changes in the shape of the mouse pointer. + * src/xdisp.c (define_frame_cursor1): Don't change the mouse + pointer shape when do_mouse_tracking has the value of 'dragging', + not just any non-nil value. (Bug#20934) + (syms_of_xdisp): DEFSYM 'dragging'. + +2015-06-30 Artur Malabarba + + * lisp/isearch.el (isearch-toggle-word): Fix toggle + + * lisp/emacs-lisp/package.el (package-compute-transaction): + Don't assume version sorting. + + * lisp/emacs-lisp/package.el (package--save-selected-packages): + Don't save before init time, to avoid overwriting configurations. + (Bug#20855) + +2015-06-30 Xue Fuqiao + + Add cross references. + * doc/emacs/display.texi (Standard Faces, Fringes): Add cross + references. + +2015-06-29 Ted Zlatanov + + cfengine.el: update for the upcoming CFEngine 3.7 release + Update for the upcoming CFEngine 3.7 release: support macros and + quoted context strings; reformat JSON; indent promise attributes 2 + units by default; give function parameter descriptions in the eldoc + glue. + * cfengine.el: Update version and docs and fix name. Autoload + `json-pretty-print'. Support new features in 3.7. + (cfengine-parameters-indent): Set default promise attribute indent to + 2 more than the promise itself. + (cfengine3-macro-regex): New variable to match the new macro syntax. + (cfengine3-font-lock-keywords): Use it to highlight macros. + (cfengine3-indent-line): Use it to indent macros to column 0. + (cfengine3-class-selector-regex): Update for the new quoted strings + format. + (cfengine3-reformat-json-string): New function to reformat a JSON + string using `json-pretty-print'. + (cfengine3-format-function-docstring): Use function parameter + description if it's provided by the cf-promises syntax dump. + +2015-06-29 Michael R. Mauger + + Cygwin emacsclient handles w32 file names + +2015-06-29 Katsumi Yamaoka + + * lisp/isearch.el (isearch-exit): Don't call isearch-done twice (bug#20925). + +2015-06-29 Eli Zaretskii + + * doc/lispref/text.texi (Sticky Properties): Improve wording. + (Bug#20924) + + Allow font names that end in "-NN", where NN is a number + * src/font.c (font_load_for_lface): If the font-spec didn't match + any available fonts, try again without interpreting trailing "-NN" + as the font size. For the description of the original problem, see + http://lists.gnu.org/archive/html/help-emacs-windows/2015-06/msg00001.html + + .gdbinit followup to changes in !USE_LSB_TAG + * src/.gdbinit (xgetsym): Don't left-shift $ptr even under + !USE_LSB_TAG, as Emacs no longer does. + +2015-06-29 Wolfgang Jenkner + + * lisp/calc-store.el (calc-insert-permanent-variable): Heed case. + Otherwise `s p' of f and F will stomp on each other's value. (Bug#20916) + +2015-06-29 Artur Malabarba + + * lisp/emacs-lisp/tabulated-list.el (tabulated-list-print): + Don't block remember-pos if buffer isn't displayed. (Bug#20921) + +2015-06-29 Nicolas Richard + + * package.el (describe-package): Use symbol-at-point as additional guess + + * package.el (describe-package): Convert the guess to a string + +2015-06-28 Paul Eggert + + apropos-library quoting fix + * lisp/apropos.el (apropos-library): Quote library consistently + with the rest of the quoting used by apropos. + + Clarify interpreter-mode-alist doc + * lisp/files.el (interpreter-mode-alist): + Reword to avoid confusing quoting that wasn't working anyway. + +2015-06-28 Michael Albinus + + Sync with Tramp 2.2.12 + * doc/misc/trampver.texi: + * lisp/net/trampver.el: Update release number. + * test/automated/tramp-tests.el (tramp-test13-make-directory): + Fix cleanup. + 2015-06-28 Artur Malabarba * lisp/isearch.el (isearch-mode): Don't char-fold regexps @@ -6926,7 +7304,7 @@ This file records repository revisions from commit 9d56a21e6a696ad19ac65c4b405aeca44785884a (exclusive) to -commit eac1271ae9dc6087be4383ded3f62ac3da030b54 (inclusive). +commit 044d4cc0c0debd4648ec637d63bcd72d4253b1cb (inclusive). See ChangeLog.1 for earlier changes. ;; Local Variables: commit 044d4cc0c0debd4648ec637d63bcd72d4253b1cb Author: Christoph Wedler Date: Fri Jun 19 13:38:24 2015 +0000 Respect `prog-indentation-context' in python.el * lisp/progmodes/python.el (python-indent-guess-indent-offset) (python-indent-context, python-indent--calculate-indentation) (python-info-current-defun) (python-info-dedenter-opening-block-message) (python-info-line-ends-backslash-p) (python-info-beginning-of-backslash) (python-info-continuation-line-p): Use `prog-widen'. (python-indent--calculate-indentation) (python-indent--calculate-levels) (python-indent-calculate-indentation): Use `prog-first-column'. (python-indent--calculate-levels): Simplify. Ignore also initial empty lines for syntax calculation. * lisp/progmodes/python.el (python-indent-context): Return :no-indent for first non-empty line, not just in line 1. * test/automated/python-tests.el (python-indent-base-case) (python-indent-inside-paren-1, python-indent-inside-paren-2) (python-indent-inside-paren-3, python-indent-inside-paren-4) (python-indent-inside-paren-5, python-indent-inside-paren-6) (python-indent-after-backslash-1) (python-indent-after-backslash-2) (python-indent-after-backslash-3) (python-indent-after-backslash-4, python-indent-inside-string-1): Expect :no-indent for first non-empty line. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index d45d082..f641880 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -734,7 +734,7 @@ work on `python-indent-calculate-indentation' instead." (interactive) (save-excursion (save-restriction - (widen) + (prog-widen) (goto-char (point-min)) (let ((block-end)) (while (and (not block-end) @@ -833,7 +833,7 @@ keyword - Point is on a line starting a dedenter block. - START is the position where the dedenter block starts." (save-restriction - (widen) + (prog-widen) (let ((ppss (save-excursion (beginning-of-line) (syntax-ppss)))) @@ -958,18 +958,20 @@ keyword ((save-excursion (back-to-indentation) (skip-chars-backward " \t\n") - (python-nav-beginning-of-statement) - (cons - (cond ((python-info-current-line-comment-p) - :after-comment) - ((save-excursion - (goto-char (line-end-position)) - (python-util-forward-comment -1) - (python-nav-beginning-of-statement) - (looking-at (python-rx block-ender))) - :after-block-end) - (t :after-line)) - (point)))))))) + (if (bobp) + (cons :no-indent 0) + (python-nav-beginning-of-statement) + (cons + (cond ((python-info-current-line-comment-p) + :after-comment) + ((save-excursion + (goto-char (line-end-position)) + (python-util-forward-comment -1) + (python-nav-beginning-of-statement) + (looking-at (python-rx block-ender))) + :after-block-end) + (t :after-line)) + (point))))))))) (defun python-indent--calculate-indentation () "Internal implementation of `python-indent-calculate-indentation'. @@ -978,10 +980,10 @@ current context or a list of integers. The latter case is only happening for :at-dedenter-block-start context since the possibilities can be narrowed to specific indentation points." (save-restriction - (widen) + (prog-widen) (save-excursion (pcase (python-indent-context) - (`(:no-indent . ,_) 0) + (`(:no-indent . ,_) (prog-first-column)) ; usually 0 (`(,(or :after-line :after-comment :inside-string @@ -1019,7 +1021,7 @@ possibilities can be narrowed to specific indentation points." (let ((opening-block-start-points (python-info-dedenter-opening-block-positions))) (if (not opening-block-start-points) - 0 ; if not found default to first column + (prog-first-column) ; if not found default to first column (mapcar (lambda (pos) (save-excursion (goto-char pos) @@ -1037,15 +1039,9 @@ integers. Levels are returned in ascending order, and in the case INDENTATION is a list, this order is enforced." (if (listp indentation) (sort (copy-sequence indentation) #'<) - (let* ((remainder (% indentation python-indent-offset)) - (steps (/ (- indentation remainder) python-indent-offset)) - (levels (mapcar (lambda (step) - (* python-indent-offset step)) - (number-sequence steps 0 -1)))) - (reverse - (if (not (zerop remainder)) - (cons indentation levels) - levels))))) + (nconc (number-sequence (prog-first-column) (1- indentation) + python-indent-offset) + (list indentation)))) (defun python-indent--previous-level (levels indentation) "Return previous level from LEVELS relative to INDENTATION." @@ -1068,7 +1064,7 @@ minimum." (python-indent--previous-level levels (current-indentation)) (if levels (apply #'max levels) - 0)))) + (prog-first-column))))) (defun python-indent-line (&optional previous) "Internal implementation of `python-indent-line-function'. @@ -4230,7 +4226,7 @@ Optional argument INCLUDE-TYPE indicates to include the type of the defun. This function can be used as the value of `add-log-current-defun-function' since it returns nil if point is not inside a defun." (save-restriction - (widen) + (prog-widen) (save-excursion (end-of-line 1) (let ((names) @@ -4413,7 +4409,7 @@ likely an invalid python file." (let ((point (python-info-dedenter-opening-block-position))) (when point (save-restriction - (widen) + (prog-widen) (message "Closes %s" (save-excursion (goto-char point) (buffer-substring @@ -4434,7 +4430,7 @@ statement." With optional argument LINE-NUMBER, check that line instead." (save-excursion (save-restriction - (widen) + (prog-widen) (when line-number (python-util-goto-line line-number)) (while (and (not (eobp)) @@ -4450,7 +4446,7 @@ With optional argument LINE-NUMBER, check that line instead." Optional argument LINE-NUMBER forces the line number to check against." (save-excursion (save-restriction - (widen) + (prog-widen) (when line-number (python-util-goto-line line-number)) (when (python-info-line-ends-backslash-p) @@ -4467,7 +4463,7 @@ When current line is continuation of another return the point where the continued line ends." (save-excursion (save-restriction - (widen) + (prog-widen) (let* ((context-type (progn (back-to-indentation) (python-syntax-context-type))) diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index ae4323b..4585e7f 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el @@ -267,10 +267,10 @@ foo = long_function_name( (should (eq (car (python-indent-context)) :no-indent)) (should (= (python-indent-calculate-indentation) 0)) (forward-line 1) - (should (eq (car (python-indent-context)) :after-line)) + (should (eq (car (python-indent-context)) :no-indent)) (should (= (python-indent-calculate-indentation) 0)) (forward-line 1) - (should (eq (car (python-indent-context)) :after-line)) + (should (eq (car (python-indent-context)) :no-indent)) (should (= (python-indent-calculate-indentation) 0)))) (ert-deftest python-indent-after-comment-1 () @@ -392,7 +392,7 @@ data = { } " (python-tests-look-at "data = {") - (should (eq (car (python-indent-context)) :after-line)) + (should (eq (car (python-indent-context)) :no-indent)) (should (= (python-indent-calculate-indentation) 0)) (python-tests-look-at "'key':") (should (eq (car (python-indent-context)) :inside-paren-newline-start)) @@ -455,7 +455,7 @@ data = {'key': { }} " (python-tests-look-at "data = {") - (should (eq (car (python-indent-context)) :after-line)) + (should (eq (car (python-indent-context)) :no-indent)) (should (= (python-indent-calculate-indentation) 0)) (python-tests-look-at "'objlist': [") (should (eq (car (python-indent-context)) :inside-paren-newline-start)) @@ -494,7 +494,7 @@ data = ('these', 'tokens') " (python-tests-look-at "data = ('these',") - (should (eq (car (python-indent-context)) :after-line)) + (should (eq (car (python-indent-context)) :no-indent)) (should (= (python-indent-calculate-indentation) 0)) (forward-line 1) (should (eq (car (python-indent-context)) :inside-paren)) @@ -514,7 +514,7 @@ data = [ [ 'these', 'are'], ['the', 'tokens' ] ] " (python-tests-look-at "data = [ [ 'these', 'are'],") - (should (eq (car (python-indent-context)) :after-line)) + (should (eq (car (python-indent-context)) :no-indent)) (should (= (python-indent-calculate-indentation) 0)) (forward-line 1) (should (eq (car (python-indent-context)) :inside-paren)) @@ -530,7 +530,7 @@ while ((not some_condition) and with_some_arg) " (python-tests-look-at "while ((not some_condition) and") - (should (eq (car (python-indent-context)) :after-line)) + (should (eq (car (python-indent-context)) :no-indent)) (should (= (python-indent-calculate-indentation) 0)) (forward-line 1) (should (eq (car (python-indent-context)) :inside-paren)) @@ -551,7 +551,7 @@ CHOICES = (('some', 'choice'), ('more', 'choices')) " (python-tests-look-at "CHOICES = (('some', 'choice'),") - (should (eq (car (python-indent-context)) :after-line)) + (should (eq (car (python-indent-context)) :no-indent)) (should (= (python-indent-calculate-indentation) 0)) (forward-line 1) (should (eq (car (python-indent-context)) :inside-paren)) @@ -612,7 +612,7 @@ from foo.bar.baz import something, something_1 \\\\ something_4, something_5 " (python-tests-look-at "from foo.bar.baz import something, something_1") - (should (eq (car (python-indent-context)) :after-line)) + (should (eq (car (python-indent-context)) :no-indent)) (should (= (python-indent-calculate-indentation) 0)) (python-tests-look-at "something_2 something_3,") (should (eq (car (python-indent-context)) :after-backslash-first-line)) @@ -639,7 +639,7 @@ objects = Thing.objects.all() \\\\ .values_list() " (python-tests-look-at "objects = Thing.objects.all()") - (should (eq (car (python-indent-context)) :after-line)) + (should (eq (car (python-indent-context)) :no-indent)) (should (= (python-indent-calculate-indentation) 0)) (python-tests-look-at ".filter(") (should (eq (car (python-indent-context)) @@ -682,7 +682,7 @@ with open('/path/to/some/file/you/want/to/read') as file_1, \\\\ " (python-tests-look-at "with open('/path/to/some/file/you/want/to/read') as file_1, \\\\") - (should (eq (car (python-indent-context)) :after-line)) + (should (eq (car (python-indent-context)) :no-indent)) (should (= (python-indent-calculate-indentation) 0)) (python-tests-look-at "open('/path/to/some/file/being/written', 'w') as file_2") @@ -703,7 +703,7 @@ super_awful_assignment = some_calculation() and \\\\ " (python-tests-look-at "super_awful_assignment = some_calculation() and \\\\") - (should (eq (car (python-indent-context)) :after-line)) + (should (eq (car (python-indent-context)) :no-indent)) (should (= (python-indent-calculate-indentation) 0)) (python-tests-look-at "another_calculation() and \\\\") (should (eq (car (python-indent-context)) @@ -992,7 +992,7 @@ lines ''' " (python-tests-look-at "multiline = '''") - (should (eq (car (python-indent-context)) :after-line)) + (should (eq (car (python-indent-context)) :no-indent)) (should (= (python-indent-calculate-indentation) 0)) (python-tests-look-at "bunch") (should (eq (car (python-indent-context)) :inside-string))