python.el: Respect process environment for remote shells
* lisp/progmodes/python.el
(python-shell-calculate-process-environment): Calculate
process-environment or tramp-remote-process-environment depending
whether current file is remote.
(python-shell-calculate-exec-path): Calculate exec-path or
tramp-remote-path depending whether current file is remote.
(python-shell-with-environment): New macro.
(python-shell-prompt-detect, python-shell-calculate-command)
(python-shell-make-comint, python-check): Use it.
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.
Ian Kelling [Mon, 6 Jul 2015 01:14:25 +0000 (18:14 -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.
Ian Kelling [Mon, 6 Jul 2015 00:00:26 +0000 (17:00 -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).
Ian Kelling [Sun, 5 Jul 2015 22:38:29 +0000 (15:38 -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).
Ian Kelling [Sun, 5 Jul 2015 22:35:23 +0000 (15:35 -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).
Ian Kelling [Sun, 5 Jul 2015 22:30:27 +0000 (15:30 -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).
Christoph Wedler [Fri, 19 Jun 2015 13:38:24 +0000 (13:38 +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.
Eli Zaretskii [Sat, 4 Jul 2015 11:23:27 +0000 (14:23 +0300)]
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.
Martin Rudalics [Fri, 3 Jul 2015 13:15:51 +0000 (15:15 +0200)]
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'.
Martin Rudalics [Thu, 2 Jul 2015 12:58:31 +0000 (14:58 +0200)]
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).
Paul Eggert [Thu, 2 Jul 2015 05:24:51 +0000 (22:24 -0700)]
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.
Eli Zaretskii [Wed, 1 Jul 2015 16:33:56 +0000 (19:33 +0300)]
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.
Eli Zaretskii [Wed, 1 Jul 2015 16:27:13 +0000 (19:27 +0300)]
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.
Stefan Monnier [Wed, 1 Jul 2015 13:31:25 +0000 (09:31 -0400)]
(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).
Glenn Morris [Tue, 30 Jun 2015 18:59:04 +0000 (14:59 -0400)]
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".
Eli Zaretskii [Tue, 30 Jun 2015 15:59:21 +0000 (18:59 +0300)]
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'.
Ted Zlatanov [Tue, 30 Jun 2015 03:07:30 +0000 (23:07 -0400)]
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.
Eli Zaretskii [Mon, 29 Jun 2015 16:10:20 +0000 (19:10 +0300)]
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
Dmitry Gutov [Fri, 26 Jun 2015 17:21:50 +0000 (20:21 +0300)]
Add --color Grep option to the command dynamically
* lisp/progmodes/grep.el (grep-template, grep-find-template):
Update the description for <C>. (Bug#20728)
(grep-compute-defaults): Don't add the --color option to
grep-options. Only add it to grep-command.
(grep-expand-keywords): Expand the env value opts into <C>.
(grep-expand-template): Replace cf in the env with the opts list,
that can include -i and --color.
* lisp/progmodes/xref.el (xref-collect-matches): Do not remove
"--color=always" from the template, because we don't have to.
Paul Eggert [Sat, 27 Jun 2015 19:16:51 +0000 (12:16 -0700)]
cl-extra fixes for most-negative-fixnum
* lisp/emacs-lisp/cl-extra.el (cl-gcd, cl-lcm, cl-random):
Don't mishandle an argument equal to most-negative-fixnum,
whose absolute value equals itself.
(cl-gcd, cl-lcm): Use dolist rather than doing it by hand.
Paul Eggert [Sat, 27 Jun 2015 17:57:02 +0000 (10:57 -0700)]
Initialize cl--gensym-counter to 0
Previously it was initialized to a random value, which made it
harder to reproduce earlier Emacs runs. The need for a random
value went away when Emacs introduced and used the #: syntax for
uninterned symbols (Bug#20862).
* doc/misc/cl.texi (Creating Symbols, Common Lisp Compatibility):
Document that cl--gensym-counter now starts with 0.
* lisp/emacs-lisp/cl-lib.el (cl--gensym-counter): Remove.
(cl--random-time): Move to near only remaining use.
* lisp/emacs-lisp/cl-macs.el (cl--gensym-counter): Initialize to 0.
Paul Eggert [Sat, 27 Jun 2015 15:34:44 +0000 (08:34 -0700)]
Improve docstring for macroexp-let2
* lisp/emacs-lisp/macroexp.el (macroexp-let2):
Improve as per suggestion by RMS in:
http://lists.gnu.org/archive/html/emacs-devel/2015-06/msg00621.html
Also, rename args to match new doc string.
Eli Zaretskii [Sat, 27 Jun 2015 11:27:23 +0000 (14:27 +0300)]
Fix VC test suite on MS-Windows
* lisp/vc/vc-svn.el (vc-svn-create-repo): Make sure the file: URL
always starts with 3 slashes after the colon.
* test/automated/vc-tests.el (vc-test--create-repo-function): Use
'w32-application-type' to invoke CVS on MS-Windows with properly
formatted CVSROOT directory name.
Eli Zaretskii [Sat, 27 Jun 2015 08:00:38 +0000 (11:00 +0300)]
Avoid error in TLS connections due to incorrect format
* src/gnutls.c (Fgnutls_boot): Use the %x conversion specifier in
the call to 'error', instead of the unsupported %u. Reported by
lo2net <fangtao0901@gmail.com>. (Bug#20908)
Eli Zaretskii [Fri, 26 Jun 2015 06:45:29 +0000 (08:45 +0200)]
Fix invisible mouse pointers on Windows.
* src/w32fns.c: Include windowsx.h.
(w32_wnd_proc): If the mouse moved and the mouse pointer is
invisible, make it visible again even when the main (Lisp)
thread is busy.
* src/w32term.c (w32_toggle_invisible_pointer): Rather then
garbaging the frame have the input thread call SetCursor.
Martin Rudalics [Fri, 26 Jun 2015 06:28:08 +0000 (08:28 +0200)]
Provide invisible mouse pointers on Windows. (Bug#6105) (Bug#12922)
* src/w32fns.c (w32_wnd_proc): Handle f->pointer_invisible
for WM_SETCURSOR and WM_EMACS_SETCURSOR cases.
* src/w32term.c (w32_hide_hourglass): Handle
f->pointer_invisible.
(w32_toggle_invisible_pointer): New function.
(w32_create_terminal): Add w32_toggle_invisible_pointer as
toggle_invisible_pointer_hook for this terminal.
Xue Fuqiao [Fri, 26 Jun 2015 01:05:40 +0000 (09:05 +0800)]
Doc fix for deletion commands
'delete-char' does not respect the value of 'delete-active-region'.
* doc/emacs/killing.texi (Deletion):
Fix documentation for some single-char deletion commands.
Paul Eggert [Thu, 25 Jun 2015 20:31:18 +0000 (13:31 -0700)]
Fix submake dependency bug with .h files
* src/Makefile.in ($(libsrc)/make-docfile$(EXEEXT)):
Depend on $(lib)/libgnu.a, so that we build $(lib)/*/*.h
before the submake in $(libsrc) would spin off a subsubmake
for $(lib) in parallel with our submake for $(lib) (Bug#20894).