1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-04 08:47:11 +00:00
Commit Graph

117013 Commits

Author SHA1 Message Date
Stefan Monnier
4ce2720e1c * test/automated/advice-tests.el (advice-test-call-interactively): Make sure
the function's definition is fully restored at the end.
2014-07-20 21:34:03 -04:00
Stefan Monnier
3241dc268e * lisp/vc/vc-bzr.el (vc-bzr-shelve): Make it operate on fileset. 2014-07-20 21:25:59 -04:00
Fabián Ezequiel Gallina
1651cf2ed5 * lisp/progmodes/python.el: Add comment about pipe buffering and
solutions for missing/delayed output in inferior Python shells.

Fixes: debbugs:17304
2014-07-20 16:51:16 -03:00
Fabián Ezequiel Gallina
f72d7fa132 * lisp/progmodes/python.el (python-mode): Don't set
mode-require-final-newline.

Fixes: debbugs:17990
2014-07-20 15:28:50 -03:00
Fabián Ezequiel Gallina
b06a0dff84 Make python.el work with IPython automatically.
* lisp/progmodes/python.el:
(python-shell-completion-setup-code): New value supporting iPython.
(python-shell-completion-string-code): New value supporting iPython.
(python-shell-completion-get-completions): Use them.
(python-shell-completion-module-string-code): Make obsolete.
(python-shell-prompt-input-regexps)
(python-shell-prompt-output-regexps): Add safeguard for ipdb.
(python-shell-output-filter): Fix comment typo.

* test/automated/python-tests.el:
(python-util-clone-local-variables-1): Fix test.

Fixes: debbugs:15510
2014-07-20 15:12:30 -03:00
Dmitry Antipov
a1edea0c88 * frame.h (struct frame) [USE_X_TOOLKIT]: New member shell_position.
* xfns.c (x_window): Use it to allow xfree later.
(x_encode_text): Drop 3rd arg; unused.  Tweak comment and adjust users
where appropriate.  Use bool for booleans and remove redundant checks.
(Fx_backspace_delete_keys_p): Use XkbFreeKeyboard; explain why.
* xterm.c (x_free_frame_resources): Free shell_position.
2014-07-20 20:14:58 +04:00
Jan Djärv
880b716696 * macfont.h (macfont_update_antialias_threshold): Declare.
* macfont.m (macfont_update_antialias_threshold): Remove static.

* nsterm.h (EmacsApp): Add antialiasThresholdDidChange.

* nsterm.m (applicationDidFinishLaunching:): Call
antialiasThresholdDidChange, register for antialias changes.
(antialiasThresholdDidChange:): New method for EmacsApp.

Fixes: debbugs:17534
2014-07-20 15:18:47 +02:00
Fabián Ezequiel Gallina
eb8cb39e89 Fix Python shell prompts detection for remote hosts.
* lisp/progmodes/python.el (python-shell-prompt-detect): Replace
call-process with process-file and make it more robust.
2014-07-19 16:19:47 -03:00
Stefan Monnier
a54493b02f * lisp/xt-mouse.el (xterm-mouse-event): Don't assume last-click is non-nil.
Fixes: debbugs:18015
2014-07-19 12:56:40 -04:00
Kenichi Handa
bf0d3f76dc 2014-07-19 Kenichi Handa <handa@gnu.org>
* xfaces.c (realize_x_face): Call font_load_for_lface with no
	mandatory font spec (Bug#17973).

2014-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>

	* font.c (font_score): Return the worst score if the size of
	ENTITY is wrong by more than a factor 2 (Bug#17973).
2014-07-20 00:18:23 +09:00
Fabián Ezequiel Gallina
d949ade3c1 Autodetect Python shell prompts.
* lisp/progmodes/python.el:
(python-shell-interpreter-interactive-arg)
(python-shell-prompt-detect-enabled)
(python-shell-prompt-detect-failure-warning)
(python-shell-prompt-input-regexps)
(python-shell-prompt-output-regexps): New vars.
(python-shell-prompt-calculated-input-regexp)
(python-shell-prompt-calculated-output-regexp): New vars.
(python-shell-get-process-name)
(python-shell-internal-get-process-name)
(python-shell-output-filter)
(python-shell-completion-get-completions): Use them.
(python-shell-prompt-detect)
(python-shell-prompt-validate-regexps): New functions.
(python-shell-prompt-set-calculated-regexps): New function.
(inferior-python-mode): Use it.  Also honor overriden
python-shell-interpreter and python-shell-interpreter-args.
(python-shell-make-comint): Honor overriden
python-shell-interpreter and python-shell-interpreter-args.
(python-shell-get-or-create-process): Make it testable by allowing
to call run-python non-interactively.
(python-util-valid-regexp-p): New function.
(python-shell-prompt-regexp, python-shell-prompt-block-regexp)
(python-shell-prompt-output-regexp)
(python-shell-prompt-pdb-regexp): Use it as defcustom :safe.

* test/automated/python-tests.el (python-shell-make-comint-1):
(python-shell-make-comint-2): Fix indentation.
(python-shell-make-comint-3)
(python-shell-make-comint-4): New tests.
(python-shell-get-or-create-process-1): Fix test.
(python-shell-get-or-create-process-2)
(python-shell-get-or-create-process-3): New tests.
(python-shell-internal-get-or-create-process-1): Fix test.
(python-shell-prompt-detect-1): New test.
(python-shell-prompt-detect-2): New test.  (Bug#17370)
(python-shell-prompt-detect-3)
(python-shell-prompt-detect-4)
(python-shell-prompt-detect-5)
(python-shell-prompt-detect-6)
(python-shell-prompt-validate-regexps-1)
(python-shell-prompt-validate-regexps-2)
(python-shell-prompt-validate-regexps-3)
(python-shell-prompt-validate-regexps-4)
(python-shell-prompt-validate-regexps-5)
(python-shell-prompt-validate-regexps-6)
(python-shell-prompt-validate-regexps-7)
(python-shell-prompt-set-calculated-regexps-1)
(python-shell-prompt-set-calculated-regexps-2)
(python-shell-prompt-set-calculated-regexps-3)
(python-shell-prompt-set-calculated-regexps-4)
(python-shell-prompt-set-calculated-regexps-5)
(python-shell-prompt-set-calculated-regexps-6)
(python-util-valid-regexp-p-1): New tests.
2014-07-19 10:13:07 -03:00
Stefan Monnier
31ca1841d2 * lisp/rect.el (rectangle--string-preview): Don't assume there
a non-nil default.

Fixes: debbugs:17984
2014-07-18 21:43:29 -04:00
Dmitry Antipov
1a5db9eb9e Prefer 'x_display_info *' to 'Display *' in X selection code.
This helps to avoid unneeded calls to x_display_info_for_display.
* xterm.h (struct selection_input_event): Record 'x_display_info *'
instead of 'Display *'.
(SELECTION_EVENT_DPYINFO): New macro.
(SELECTION_EVENT_DISPLAY): Now inline function to prohibit using
it as an lvalue.  Mention this in comment.
* xterm.c (handle_one_xevent): Use SELECTION_EVENT_DPYINFO.
* xselect.c (x_get_window_property_as_lisp_data, x_atom_to_symbol)
(selection_data_to_lisp_data, receive_incremental_selection):
Convert to use 'x_display_info *'.  Adjust users where appropriate.
(lisp_data_to_selection_data): Likewise.  Also pass 'struct
selection data *' as last arg to not return values in args.
(unexpect_property_change): Use common removal technique.
2014-07-18 15:04:37 +04:00
Albert Krewinkel
32a608307c * lisp/gnus/gnus-msg.el (gnus-configure-posting-style):
Allow string replacements in values when matching against a header.

* doc/misc/gnus.texi (Posting Styles): Document the possibility to
perform string replacements when matching against headers.
2014-07-18 08:23:49 +00:00
Dmitry Antipov
0e6040770c * frame.c (frame_unspecified_color): New function
refactored out from ...
(Fframe_parameters, Fframe_parameter): ... adjusted users.
(x_fullscreen_adjust, set_frame_param): Move Windows-specific
function to ...
* w32term.c (x_fullscreen_adjust, set_frame_param): ... static here.
* frame.h (x_fullscreen_adjust) [HAVE_NTGUI]:
* lisp.h (set_frame_param): Remove prototype.
* xterm.c (x_display_pixel_width, x_display_pixel_height): Now ...
* xterm.h (x_display_pixel_width, x_display_pixel_height): ...
inlined from here.
2014-07-18 10:02:19 +04:00
Eli Zaretskii
64384ca4de Fix last commit of src/w16select.c. 2014-07-17 18:40:18 +03:00
Eli Zaretskii
449c428491 Fix src/ChangeLog entry of last commit. 2014-07-17 18:39:07 +03:00
Eli Zaretskii
e8bd4b948b Fix setting up coding-systems for clipboard access on MS-Windows and MS-DOS.
src/w32select.c (setup_windows_coding_system): Apply
 CODING_ANNOTATION_MASK to the common_flags member of struct
 coding_system.  Reported by Martin Rudalics <rudalics@gmx.at>.
 src/w16select.c (Fw16_get_clipboard_data): Apply
 CODING_ANNOTATION_MASK to the common_flags member of struct
 coding_system.
2014-07-17 18:37:48 +03:00
Eli Zaretskii
9180cde112 Fix assertion violation when restoring hscrolled window configurations.
src/xdisp.c (hscroll_window_tree): Don't try hscrolling windows whose cursor
 row has zero buffer position as their start position.  Reported by
 Martin Rudalics <rudalics@gmx.at>.
2014-07-17 18:25:21 +03:00
Eli Zaretskii
137448c093 Fix part of bug #18035 with overlay strings on invisible text.
src/xdisp.c (init_iterator): Initialize it->stop_charpos to the
 buffer position where we are to start the iteration.
 (handle_invisible_prop): Record in it->stop_charpos the position
 where the invisible text ends.
2014-07-17 18:17:52 +03:00
Dmitry Antipov
5d59504a31 * data.c (wrong_choice): Not static any more.
* lisp.h (wrong_choice): Add prototype.
* frame.h (struct frame) [USE_X_TOOLKIT || HAVE_NTGUI]:
Declare namebuf as such.  Tweak comment.
[USE_GTK]: Likewise for tool_bar_position.
(fset_tool_bar_position) [USE_GTK]: Ditto.
(FRAME_TOOL_BAR_POSITION): New macro.
* frame.c (x_report_frame_params):
* gtkutil.c (update_frame_tool_bar):
* xfns.c (Fx_create_frame): Use it.
(x_set_tool_bar_position): Add meaningful diagnostic messages.
2014-07-17 14:18:19 +04:00
Dmitry Antipov
b1bfebbfc5 * print.c (print_preprocess): Adjust to match changed
sub char-table structure and avoid crash (Bug#18038).
2014-07-17 13:12:51 +04:00
Eli Zaretskii
56968aa61c Fix bug #18036 with infloop in redisplay with huge fringes.
src/xdisp.c (move_it_vertically_backward, move_it_by_lines): Prevent
 infinite looping in redisplay when display lines don't have enough
 space to display even a single character.
2014-07-16 21:39:35 +03:00
Glenn Morris
02a7e500e8 Merge from emacs-24; up to 2014-06-23T06:25:47Z!rgm@gnu.org 2014-07-16 13:06:12 -04:00
Dmitry Antipov
70f8097ea2 * frame.h (enum fullscreen_type) [HAVE_WINDOW_SYSTEM]: Use more natural
values.  Add comment.
(struct frame): Re-arrange layout to avoid extra padding and use bit
fields for output_method, want_fullscreen and vertical_scroll_bar_type.
(FRAME_VERTICAL_SCROLL_BAR_TYPE, FRAME_HAS_VERTICAL_SCROLL_BARS)
(FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT)
(FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT) [!HAVE_WINDOW_SYSTEM]:
Define as no-ops because there are no scroll bars anyway.
* frame.c (make_frame, make_terminal_frame, make_initial_frame):
Adjust users.

* font.c (fset_font_data) [HAVE_XFT || HAVE_FREETYPE]:
Add convenient setter.
(font_put_frame_data, font_get_frame_data): Use it.
2014-07-16 19:39:15 +04:00
Dmitry Antipov
e0b07ec341 More precise control over values of some buffer-local variables.
* keyboard.c (Qvertical_scroll_bar):
* frame.c (Qleft, Qright): Move to ...
* buffer.c (Qleft, Qright, Qvertical_scroll_bar): ... here.
* buffer.c (Qchoice, Qrange, Qoverwrite_mode, Qfraction): New symbols.
(syms_of_buffer): DEFSYM all of the above, attach special properties.
Use special symbols to DEFVAR_PER_BUFFER overwrite-mode,
vertical-scroll-bar, scroll-up-aggressively
and scroll-down-aggressively.
* buffer.h (Qchoice, Qrange, Qleft, Qright, Qvertical_scroll_bar):
Add declarations.
* nsfns.m, frame.h (Qleft, Qright):
* nsterm.m (Qleft): Remove declarations.
* gtkutil.c (toplevel): Include buffer.h.
* data.c (wrong_choice, wrong_range): New functions.
(store_symval_forwarding): Handle special properties of buffer-local
variables and use functions from the above to signal error, if any.
2014-07-16 12:45:22 +04:00
Daiki Ueno
74660d84d9 Revert 2014-07-16T04:11:08Z!ueno@gnu.org and fix XCHAR2B_BYTE[12] in nsgui.h only
* nsgui.h (XCHAR2B_BYTE1): Add missing parentheses around
pointer argument, before dereferencing.
(XCHAR2B_BYTE2): Likewise.
2014-07-16 14:44:05 +09:00
Daiki Ueno
037a830b50 Remove unnecessary ifdef from nsgui.h, introduced by my last commit 2014-07-16 13:40:43 +09:00
Daiki Ueno
7ec2c0effc Move back the XChar2b definition to w32gui.h and nsgui.h
Fix the last change.  XChar2b still needs to be defined platform dependently,
to match with the argument types of drawing functions.
2014-07-16 13:31:31 +09:00
Glenn Morris
61dcf9bc85 * lisp/desktop.el (after-init-hook): Disable startup frame restoration
in non-graphical situations.

Fixes: debbugs:17693
2014-07-15 21:28:42 -07:00
Daiki Ueno
1c6fefc955 Consolidate XChar2b macros for the X, W32, and NS
Suggested by Jan Djärv in:
https://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00203.html
* w32gui.h (XChar2b, STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2):
Move the fallback definitions to dispextern.h.
* nsgui.h (XChar2b, STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2):
Likewise.  Share the same definition with W32.
* xterm.h (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): Move to ...
* dispextern.h (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2):
... here for the consistency with W32 and NS.
2014-07-16 13:11:08 +09:00
Paul Eggert
7e6d13fea4 Use "b" flag more consistently; avoid "t".
* make-docfile.c (READ_TEXT): Remove; all uses replaced by "r".
(READ_BINARY): Remove; all uses replaced by "rb".

Fixes: debbugs:18006
2014-07-15 12:28:25 -07:00
Eli Zaretskii
50426c32c9 etc/TODO: Minor updates. 2014-07-15 19:11:33 +03:00
Alvar Jesus Ibeas Martin
526e7132b8 Fix bug #18025 with typos in Emacs Lisp Introduction manual.
doc/lispintro/emacs-lisp-intro.texi (Variables, Buffer Names, if & or)
 (Symbols as Chest, fwd-para while): Fix typos.
2014-07-15 19:06:49 +03:00
Dmitry Antipov
6f50c78e70 * regex.c (re_search_2): Use ssize_t to avoid integer overflow. 2014-07-15 18:04:06 +04:00
Dmitry Antipov
60c6e448eb * lwlib/lwlib.h (toplevel): Use unsigned int for LWLIB_ID.
* src/xmenu.c (toplevel): Use LWLIB_ID for next_menubar_widget_id.
(pop_down_menu) [USE_X_TOOLKIT]: Accept integer arg.
(create_and_show_popup_menu, create_and_show_dialog) [USE_X_TOOLKIT]:
Use record_unwind_protect_int and avoid consing.
(syms_of_xmenu) [USE_X_TOOLKIT]: Declare WIDGET_ID_TICK_START.
2014-07-15 13:59:05 +04:00
Daniel Colascione
fb32e9f8f3 Unbreak compilation of derived cc-mode modes
* lisp/progmodes/cc-defs.el (c-lang-defconst-eval-immediately):
Use `macroexpand-all' instead of `cl-macroexpand-all'.

* lisp/progmodes/cc-langs.el: Change comments from `cl-macroexpand-all'
to `macroexpand-all'
2014-07-14 16:58:52 -07:00
Glenn Morris
be8b1ebb5c Tweak earlier vc-log-edit change
* lisp/vc/vc-dispatcher.el (vc-log-edit): Do set up the log buffer
if it was "empty", or used for a different set of files.

Fixes: debbugs:17884
2014-07-14 15:29:29 -04:00
Paul Eggert
ba1ed52f0c Use binary-io module, O_BINARY, and "b" flag.
* admin/merge-gnulib (GNULIB_MODULES): Add binary-io.  It was already
present implicitly; this just makes the dependence explicit.
* lib-src/etags.c, lib-src/hexl.c, lib-src/make-docfile.c:
Include binary-io.h instead of fcntl.h and/or io.h.
(main): Use set_binary_mode or SET_BINARY
in place of handcrafted code.
* lib-src/etags.c (main) [DOS_NT]:
* lib-src/movemail.c (main) [WINDOWSNT]:
Don't mess with _fmode.
* lib-src/etags.c (main, process_file_name, analyse_regex):
Use fopen/popen's "b" flag instead.
* lib-src/movemail.c (main, popmail): Use open/lk_open/mkostemp's O_BINARY
instead.
* src/callproc.c (create_temp_file): Use mkostemp's O_BINARY flag.
* src/emacs.c [MSDOS]:
* src/emacs.c (main) [DOS_NT]: Don't mess with _fmode.
(main) [MSDOS]: Use SET_BINARY instead of setmode.
* src/minibuf.c: Include binary-io.h instead of fcntl.h.
(read_minibuf_noninteractive):
Use set_binary_mode instead of handcrafted code.
Don't call emacs_set_tty if emacs_get_tty failed.
* src/sysdep.c, src/systty.h (emacs_get_tty): Return int, not void.
* src/sysdep.c (emacs_open, emacs_pipe): Use O_BINARY.
* src/w32.c (pipe2): Adjust eassert to include O_BINARY.

Fixes: debbugs:18006
2014-07-14 12:23:18 -07:00
Paul Eggert
091adafaac * macros.c (Fstart_kbd_macro): Avoid need for overflow check. 2014-07-14 12:07:54 -07:00
Paul Eggert
918be62752 * macros.c (Fstart_kbd_macro): Simplify.
This works around a GCC compiler bug when Emacs is configured with
--enable-gcc-warnings.
2014-07-14 11:56:35 -07:00
Eli Zaretskii
3d743935a0 src/ChangeLog: Fix a typo in a recently added entry. 2014-07-14 18:10:20 +03:00
Dmitry Antipov
c299f850cd * term.c (tty_menu_add_pane, tty_menu_add_selection):
Use menu_item_width.
(tty_menu_show): Simplify because ty_menu_create never return NULL.
2014-07-14 19:06:52 +04:00
Dmitry Antipov
201b685783 * lisp.h (CHECK_VECTOR_OR_STRING): Return number of elements
or characters in string, respectively.  Add comment.
* fringe.c (Fdefine_fringe_bitmap):
* fns.c (Fsubstring, substring_both): Use it.
* keymap.c (Fdefine_key, Flookup_key):
* macros.c (Fstart_kbd_macro): Likewise.  Avoid call to Flength.
2014-07-14 08:44:01 +04:00
Paul Eggert
a705278de7 * make-docfile.c: Simplify a bit, to simplify further refactoring.
(outfile): Remove static var.  All uses changed to use stdout,
since it's always stdout anyway.  While we're at it, prefer
putchar/puts/fputs to printf when there are no format strings.
(main): Use freopen rather than fopen, so that stdout is reused.
Move O_BINARY stuff after the freopen, so it affects the
reopened file.
(write_c_args): Omit first arg, since it's always stdout now.
All uses changed.
2014-07-13 17:45:19 -07:00
Paul Eggert
4939f58d2c Improve behavior of 'bzr up; cd src; make -k'.
* Makefile.in (ACLOCAL_INPUTS): Add all m4/*.m4 files.
* src/Makefile.in (top_srcdir): New var.
(ntsource, lispsource, ALL_CFLAGS, gl-stamp, emacs.res):
Use '$(top_srcdir)' instead of '$(srcdir)/..';
its expansion is a bit shorter.
(../config.status): Actually build config.status instead of
just complaining.
(ACLOCAL_INPUTS, AUTOCONF_INPUTS):
New macros, copied and relocated from ../Makefile.in.
($(top_srcdir)/aclocal.m4, $(top_srcdir)/configure, config.in)
(../config.status, Makefile): New dependencies and rules,
copied with relocation from ../Makefile.in.  This should be more
likely to rebuild the build machinery properly if you do a 'make'
in the src directory.
2014-07-13 08:50:35 -07:00
Eli Zaretskii
b20759f920 Fix bug #17986 with infloop in redisplay when default-directory is nil.
src/xdisp.c (decode_mode_spec): Call file-remote-p on the current
 buffer's default-directory only if it is a string.

 lisp/bindings.el (mode-line-remote): If default-directory is not a
 string, don't call file-remote-p on it; instead state in the
 help-echo that it is nil.
2014-07-13 17:49:59 +03:00
Paul Eggert
d105c56ff9 Merge from gnulib, incorporating:
2014-06-27 mktime: merge #if/#ifdef usage from glibc
* lib/mktime.c: Update from gnulib.
2014-07-12 13:02:44 -07:00
Glenn Morris
b39c4d7b33 Merge from emacs-24; up to 2014-06-22T05:00:14Z!dmantipov@yandex.ru 2014-07-12 10:53:29 -07:00
Paul Eggert
fb02552638 * etags.c (Lisp_functions): Also record cl-defun etc.
Fixes: debbugs:17965
2014-07-12 09:26:54 -07:00