1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-29 07:58:28 +00:00
Commit Graph

431 Commits

Author SHA1 Message Date
Paul Eggert
877e808440 Free cwd when no longer needed
* lib-src/emacsclient.c (main): Don’t dally when freeing cwd.
2017-05-31 22:38:32 -07:00
Anders Waldenborg
c221f1466e Fix memory leak of cwd string in emacsclient (Bug#26628)
* lib-src/emacsclient.c (main): emacsclient retrieves the current
working directory using get_current_dir_name which returns a newly
allocated string.  Make sure this string is freed before exiting.

Copyright-paperwork-exempt: yes
2017-05-31 22:58:30 -04:00
Eli Zaretskii
7430617d3d Support remote editing in emacsclient via Tramp
* lib-src/emacsclient.c (main, decode_options)
(print_help_and_exit, longopts): New option '--tramp' / '-T' which
specifies how emacs should use tramp to find remote files.

* doc/emacs/misc.texi (TCP Emacs server): New subsection describing
the various knobs to tune server.el for TCP opereation.
(emacsclient Options): Reference "TCP Emacs server" from description of
--server-file.  Document the new '--tramp' / '-T' options.
* doc/emacs/emacs.texi (Top): Update the top-level menu.

* etc/NEWS: Mention the new option.
2017-05-19 11:51:16 +03:00
Peder O. Klingenberg
ecbd5f9ac6 New option -u / --suppress-output to emacsclient
* lib-src/emacsclient.c (print_help_and_exit, longopts)
(decode_options, main): Implement new option --suppress-output / -u to
suppress printing of eval-results.
* doc/emacs/misc.texi (emacsclient Options): Document the new
"--suppress-output/-u" options.
* etc/NEWS: Mention the new options.
2017-02-25 10:30:46 +02:00
Paul Eggert
bcf244ef9b Merge from origin/emacs-25
2e2a806 Fix copyright years by hand
5badc81 Update copyright year to 2017
2017-01-01 01:10:47 -08:00
Paul Eggert
5badc81c1c Update copyright year to 2017
Run admin/update-copyright.
2016-12-31 19:42:26 -08:00
Paul Eggert
86baa208f8 Port emacsclient to FreeBSD 11 etc.
* lib-src/emacsclient.c: Include <string.h>.  This is needed on
platforms like FreeBSD 11 that use code involving strlen etc., and
because <config.h> no longer includes string.h.
2016-11-08 08:54:51 -08:00
Paul Eggert
f4eb890029 Limit <config.h>’s includes
This follows up on recent problems with the fact that config.h
includes stdlib.h etc.; some files need to include stdlib.h later.
config.h generally should limit itself to includes that are
universally safe; outside of MS-Windows, only stdbool.h makes
the cut among the files currently included.  So, move the
other includes to just the files that need them (Bug#24506).
* configure.ac (config_opsysfile): Remove, as this generic hook
is no longer needed.
* lib-src/etags.c, src/unexmacosx.c, src/w32.c, src/w32notify.c:
* src/w32proc.c (_GNU_SOURCE):
Remove, as it’s OK for config.h to do this now.
* src/conf_post.h: Include <ms-w32.h>, instead of the generic
config_opsysfile, for simplicity as this old way of configuring is
now done only for the MS-Windows port.  Do not include <ms-w32.h>
if DEFER_MS_W32_H, for the benefit of the few files that want its
effects later.  Do not include <alloca.h>, <string.h>, or
<stdlib.h>.  Other files modified to include these headers as
needed, or to not include headers that are no longer needed.
* src/lisp.h: Include <alloca.h> and <string.h> here, since
some of the inline functions need them.
* src/regex.c: Include <alloca.h> if not emacs.  (If emacs,
we can rely on SAFE_ALLOCA.)  There is no longer any need to
worry about HAVE_ALLOCA_H.
* src/unexmacosx.c: Rely on config.h not including stdlib.h.
* src/w32.c, src/w32notify.c, src/w32proc.c (DEFER_MS_W32_H):
Define before including <config.h> first, and include <ms-w32.h>
after the troublesome headers.
2016-09-30 12:38:52 -07:00
Michal Nazarewicz
ef474bd3d6 Fix compiler thinking tmpdir may be unitialised in emacsclient
This fixes the following warning:

	emacsclient.c: In function ‘set_local_socket’:
	/usr/include/x86_64-linux-gnu/bits/string3.h:111:3: error:
		‘tmpdir’ may be used uninitialized in this function
		[-Werror=maybe-uninitialized]
	   return __builtin___stpcpy_chk (__dest, __src, __bos (__dest));
	   ^
	emacsclient.c:1197:17: note: ‘tmpdir’ was declared here
	     const char *tmpdir;

* lib-src/emacsclient.c (set_local_socket): Get rid of use_tmpdir
variable and instead use tmpdir being non-NULL as sign that it should
be used.
2016-09-12 21:57:36 +02:00
Eli Zaretskii
d0e1774a58 Fix compilation warning in the MinGW build
* nt/inc/ms-w32.h: Include stdint.h.
(_execvp, execve): Provide prototypes.

* lib-src/emacsclient.c [WINDOWSNT]: Remove prototype for execvp,
it is now in nt/inc/ms-w32.h.
* lib-src/ntlib.c (getppid): Avoid compiler warnings due to format
mismatch.
(sys_ctime): Remove, not used.
2016-07-22 20:38:22 +03:00
Paul Eggert
237244bbd5 Omit IF_LINT code that no longer seems needed
Nowadays GCC is smarter, or the Emacs code has mutated, or both,
and now is as good a time as any to remove uses of IF_LINT that
now seem to be unnecessary.
* lib-src/emacsclient.c (set_local_socket):
* lib-src/movemail.c (main) [MAIL_USE_MAILLOCK && HAVE_TOUCHLOCK]:
* src/buffer.c (fix_start_end_in_overlays, fix_overlays_before):
* src/casefiddle.c (casify_region):
* src/charset.c (load_charset_map):
* src/coding.c (decode_coding_object, encode_coding_object):
* src/data.c (Fmake_variable_buffer_local, Fmake_local_variable)
(cons_to_unsigned, cons_to_signed):
* src/frame.c (make_frame, x_set_frame_parameters):
* src/keyboard.c (read_event_from_main_queue):
* src/regex.c (regex_compile):
* src/syntax.c (back_comment):
* src/window.c (Frecenter):
* src/xfaces.c (Fx_list_fonts):
Remove IF_LINT that no longer seems necessary.
* src/image.c (png_load_body, jpeg_load_body): Simplify use of IF_LINT.
* src/keyboard.c (read_char): Use IF_LINT (volatile) rather than
a pragma dance to pacify GCC -Wclobbered.
* src/xdisp.c (x_produce_glyphs): Rewrite to avoid need for IF_LINT.

* src/xterm.c (x_connection_closed): Now _Noreturn, which should
mean we do not need IF_LINT any more.
(x_io_error_quitter): Now _Noreturn.  Put an 'assume (false)’
at the end, to forestall warnings from older compilers.
2016-05-30 16:13:04 -07:00
Eli Zaretskii
cb5af79249 Fix compiler warnings in the MinGW build
* configure.ac [mingw32]: Don't add -Wpointer-sign, and add
-Wno-pointer-sign, to keep the noise level down.

* nt/mingw-cfg.site (gl_cv_warn_c__Wredundant_decls): Disable
-Wredundant-decls, as that produces a lot of noise due to
redeclaration of time-related functions by gnulib.
* nt/runemacs.c (set_user_model_id): Fix argument type of
'SetCurrentProcessExplicitAppUserModelID'.

* src/image.c (x_create_bitmap_from_file) [HAVE_NTGUI]: Don't
declare 'dpyinfo', as it is unused.
(xpm_load): Fix warnings about pointer signedness.
* src/w32proc.c (IsValidLocale, init_winsock): Remove redundant
prototypes.
(sys_spawnve): Avoid warnings about discarding 'const' qualifier.
(sys_select): Provide prototype.
(g_b_init_compare_string_w): Move declaration to file scope.
* src/w32heap.c (dumped_data_commit): Now static.
(FREEABLE_P): Avoid warnings about pointer comparison with integer.
(mmap_realloc): Cast to 'char *' for arithmetics on void pointers.
* src/w32console.c (ctrl_c_handler, sys_tputs, sys_tgetstr)
(evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear):
Provide prototypes.
* src/w32.c (globals_of_w32, conv_sockaddr_to_lisp): Remove
redundant prototypes.
(w32_get_internal_run_time, map_w32_filename): Provide prototype.
(init_environment, sys_ctime): Avoid warnings about discarding
'const' qualifier.
Include utimens.h.
(sys_ctime, sys_chdir, sys_creat, sys_fopen, sys_mkdir)
(sys_open, sys_rename, sys_rmdir, is_slow_fs, term_winsock)
(sys_close, sys_dup2, sys_read, sys_write, sys_localtime): Provide
prototypes.
(sys_rename_replace): Use %d to avoid compiler warnings.
(_wsa_errlist): Make the message text 'const char *', to avoid
compilation warnings.
(dynlib_reset_last_error): Move prototype to file scope.
(w32_get_resource): First argument is now 'const char *'.
* src/w32uniscribe.c (syms_of_w32uniscribe): Provide prototype.
(otf_features): Second argument is no 'const char *'.
* src/w32term.c (free_frame_menubar, x_wm_set_size_hint)
(x_set_window_size): Remove redundant prototypes.
(XChangeGC, XGetGCValues, w32_draw_underwave)
(w32_draw_rectangle, w32_shift_glyphs_for_insert, x_mouse_leave)
(x_calc_absolute_position, x_destroy_window): Now static.
(menubar_selection_callback): Move prototype to file scope.
* src/w32font.c (g_b_init_get_glyph_outline_w): Remove redundant
declaration.
(w32_to_x_charset): Fix warnings about discarding 'const' qualifier.
(w32font_full_name): Fix warnings about implicit conversion of
'float' to 'double'.
* src/w32reg.c (w32_get_rdb_resource): Fix warnings about
discarding 'const' qualifier.
* src/w32menu.c (syms_of_w32menu, globals_of_w32menu)
(set_frame_menubar): Remove redundant prototypes.
(menubar_selection_callback, w32_menu_display_help): Provide
prototypes.
(simple_dialog_show): Avoid warnings about discarding 'const'
qualifier.
* src/w32fns.c (syms_of_w32fns, globals_of_w32fns)
(free_frame_menubar, w32_strerror, x_set_menu_bar_lines)
(x_set_tool_bar_lines, x_set_internal_border_width): Remove
redundant prototypes.
(current_popup_menu): Remove redundant declaration.
(colormap_t): Member 'name' is now 'const char *'.
(add_system_logical_colors_to_map): Fix signed/unsigned warnings.
(x_decode_color, x_set_border_pixel)
(x_clear_under_internal_border, x_set_name, hook_w32_key)
(reset_w32_kbdhook_state, deliver_wm_chars, w32_backtrace): Now
static.
(w32_load_cursor, w32_key_to_modifier, map_keypad_keys)
(w32_msg_worker, w32_last_error): Provide prototypes.
(funhook, lookup_vk_code): Avoid warnings about missing
parentheses.
(x_default_font_parameter, Fw32_notification_notify): Avoid
warnings about discarding 'const' qualifier.
(Fx_create_frame): Avoid warnings about empty body of 'else'.
(x_screen_planes): Ifdef away unused function.
(Fx_show_tip): Remove unused variables.
(Fw32_battery_status): Avoid warnings about implicit promotion
from float to double.
(Fw32_notification_notify): Initialize 'timeout'.
* src/profiler.c (profiler_cpu_running) [HAVE_ITIMERSPEC]: Only
define the TIMER_SETTIME_RUNNING value if it will be used.
* src/w32notify.c (send_notifications): Ifdef away an empty if
clause.  Remove unused variable.
(watch_end, watch_completion): Provide prototypes.
* src/sound.c (sound_warning) [WINDOWSNT]: Don't define: unused.
* src/callproc.c (child_setup, getenv_internal_1) [WINDOWSNT]: Fix
warning with pointer signedness.
* src/gnutls.c (gnutls_x509_crt_get_signature)
(gnutls_alert_send_appropriate) [WINDOWSNT]: Don't define, and
don't load them from the GnuTLS library, as they are no longer
used.
* src/process.c (DATAGRAM_CHAN_P) [!DATAGRAM_SOCKETS]: Don't
define, as it's unused.
* src/unexw32.c (open_input_file, open_output_file)
(close_file_data): Remove redundant prototypes.
(_start): provide prototype.
(mainCRTStartup): Move prototype to file level.
(find_section): Use type-cast to shut up compiler warnings.
(offset_to_section, relocate_offset): Now static.
(find_section): First argument is now a 'const char *'.
(offset_to_section): Ifdef away, as it's unused.
* src/w32heap.h (find_section): Adjust prototype.
* src/dynlib.c (dynlib_reset_last_error): Provide prototype.
* src/dired.c (directory_files_internal_w32_unwind): Avoid
warnings about missing prototypes.
(is_slow_fs) [WINDOWSNT]: Provide prototype at file level.
(directory_files_internal) [WINDOWSNT]: Fix warnings about pointer
signedness.
* src/fileio.c (Ffile_writable_p, Ffile_regular_p) [WINDOWSNT]:
Fix warnings about pointer signedness.
* src/filelock.c (WTMP_FILE) [WINDOWSNT]: Don't define, it's
unused.
* src/sysdep.c (_getpid): Remove redundant prototype.
(sys_subshell) [DOS_NT]: Don't define 'status', it's unused.
[!MSDOS]: Don't define 'st', it's unused.
(init_sys_modes) [DOS_NT]: Don't define 'terminal', it's unused.
(str_collate) [WINDOWSNT]: Avoid warnings about pointer signedness.
* src/keyboard.c (tty_read_avail_input) [WINDOWSNT]: Don't define
n_to_read, as it is not used.
(MAX_ENCODED_BYTES) [WINDOWSNT]: Don't define, as it's unused.
* src/w32font.h (syms_of_w32font): Remove redundant prototype.
* src/xfaces.c (x_display_info) [HAVE_NTGUI]: Remove unused macro.
* src/term.c (init_tty) [DOS_NT]: Ifdef away variables that are
not used by DOS_NT builds, to avoid compiler warnings.
* src/menu.c (current_popup_menu) [HAVE_NTGUI]: Remove redundant
declaration.
* src/dispnew.c (init_display) [WINDOWSNT]: Use type-cast to shut
up compiler warnings.
* src/w32term.h (x_set_window_size, x_get_focus_frame)
(x_make_frame_visible, x_make_frame_invisible, x_iconify_frame)
(x_set_frame_alpha, x_activate_menubar, x_bitmap_icon)
(x_free_frame_resources, x_real_positions)
(display_x_get_resource): Remove redundant prototypes.

* lib-src/ntlib.c (sys_ctime, sys_fopen, sys_chdir, mkostemp)
(sys_rename, gettimeofday): Provide prototypes.
* lib-src/ntlib.h (getuid, geteuid, mkostemp): Remove redundant
declarations.
* lib-src/emacsclient.c (w32_getenv): Argument is now 'const char *'.
(xstrdup, w32_get_resource, w32_window_app, w32_execvp, ttyname)
(close_winsock, initialize_sockets, w32_set_user_model_id)
(w32_find_emacs_process, w32_give_focus) [WINDOWSNT]: Add
prototypes.
(w32_get_resource) [WINDOWSNT]: Fix a warning about signedness
difference.
(w32_set_user_model_id): Update prototype of
SetCurrentProcessExplicitAppUserModelID to avoid compiler
warnings.
(start_daemon_and_retry_set_socket) [WINDOWSNT]: Use type-cast to
shut up compiler warnings.
* lib-src/etags.c (MAXPATHLEN) [WINDOWSNT]: Remove unused macro.
2016-05-21 20:06:33 +03:00
Paul Eggert
7352c6c695 Rework C source files to avoid ^(
Work around Bug#22884 by rewording comments and strings to avoid ‘(’
at the start of a line unless it starts a function.  This change
is a short-term hack; in the longer run we plan to fix cc-mode’s
performance for C files that have ‘(’ at the start of a line in a
comment or string.
2016-03-10 07:59:19 -08:00
Paul Eggert
0e963201d0 Update copyright year to 2016
Run admin/update-copyright.
2016-01-01 01:34:24 -08:00
Paul Eggert
2934c21f2d Use straight quotes in lib-src diagnostics
These auxiliary programs can’t use Emacs’s text-quoting-style,
and it’s too much trouble to redo that mechanism by hand.
So just use straight quotes for now.
* lib-src/ebrowse.c (main):
* lib-src/emacsclient.c (decode_options, main):
* lib-src/etags.c (Ada_help, default_C_help, Cplusplus_help)
(Forth_help, HTML_help, Lisp_help, Makefile_help, Objc_help)
(Perl_help, PHP_help, Python_help, Scheme_help, TeX_help, auto_help)
(none_help, print_language_names, print_help, add_regex)
(suggest_asking_for_help):
* lib-src/make-docfile.c (write_c_args, scan_c_stream):
Use straight quotes in diagnostics.
2015-08-27 02:37:35 -07:00
Evgeny Fraimovitch
c6a626ebac Don't abort emacsclientw when -a was specified
* lib-src/emacsclient.c (set_tcp_socket) [WINDOWSNT]: Don't error
out if we are in emacsclientw and -a was specified.

Copyright-paperwork-exempt: yes
2015-08-02 17:48:42 +03:00
Stefan Monnier
ea92591983 Change defgeneric so it doesn't completely redefine the function
* lisp/emacs-lisp/cl-generic.el (cl-generic-define): Don't throw away
previously defined methods.
(cl-generic-define-method): Let-bind purify-flag instead of using `fset'.
(cl--generic-prefill-dispatchers): Only define during compilation.
(cl-method-qualifiers): Remove redundant alias.
(help-fns-short-filename): Silence byte-compiler.
* test/automated/cl-generic-tests.el: Adjust to new defgeneric semantics.
2015-05-21 23:46:10 -04:00
Mark Laws
805fe50708 Support daemon mode on MS-Windows (bug#19688)
src/emacs.c <w32_daemon_event> [WINDOWSNT]: New global var.
 (main) [WINDOWSNT]: Initialize it to NULL.  Create the event to
 signal clients we are ready for connections.
 (Fdaemon_initialized): Use DAEMON_RUNNING.
 [WINDOWSNT]: MS-Windows specific code to signal clients we are
 ready for connections.
 src/lisp.h (DAEMON_RUNNING): New macro, encapsulates Posix and
 MS-Windows conditions for running in daemon mode.
 src/minibuf.c (read_minibuf): Use DAEMON_RUNNING.
 src/keyboard.c (kbd_buffer_get_event): Use DAEMON_RUNNING.
 src/dispnew.c (init_display) [WINDOWSNT]: Initialize frames/terminal
 even in daemon mode.

 nt/inc/ms-w32.h (W32_DAEMON_EVENT): New macro.

 lib-src/emacsclient.c (decode_options) [WINDOWSNT]: Don't reject empty
 arguments for --alternate-editor.
 (print_help_and_exit) [WINDOWSNT]: Don't refrain from advertising
 empty arguments for --alternate-editor.
 (start_daemon_and_retry_set_socket) [WINDOWSNT]: MS-Windows
 specific code to start Emacs in daemon mode and wait for it to be
 ready for client connections.

 lisp/server.el (server-process-filter): Force GUI frames on
 MS-Windows in daemon mode, even if a TTY frame was requested.
 lisp/frameset.el (frameset-keep-original-display-p): Don't assume
 windows-nt cannot be in daemon mode.
 lisp/frame.el (window-system-for-display): Don't assume windows-nt
 cannot be in daemon mode.
2015-02-27 12:43:30 +02:00
Paul Eggert
7e09ef09a4 Update copyright year to 2015
Run admin/update-copyright.
2015-01-01 14:26:41 -08:00
Paul Eggert
1e6879dbdb Prefer stpcpy to strcat
* admin/merge-gnulib (GNULIB_MODULES): Add stpcpy.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/stpcpy.c, m4/stpcpy.m4: New files, from gnulib.
* lib-src/ebrowse.c (sym_scope_1, operator_name, open_file):
* lib-src/emacsclient.c (get_server_config, set_local_socket)
(start_daemon_and_retry_set_socket):
* lib-src/etags.c (main, C_entries, relative_filename):
* lib-src/pop.c (sendline):
* lib-src/update-game-score.c (main):
* lwlib/xlwmenu.c (resource_widget_value):
* src/callproc.c (child_setup):
* src/dbusbind.c (xd_signature_cat):
* src/doc.c (get_doc_string, Fsnarf_documentation):
* src/editfns.c (Fuser_full_name):
* src/frame.c (xrdb_get_resource):
* src/gtkutil.c (xg_get_file_with_chooser):
* src/tparam.c (tparam1):
* src/xfns.c (xic_create_fontsetname):
* src/xrdb.c (gethomedir, get_user_db, get_environ_db):
* src/xsmfns.c (smc_save_yourself_CB):
Rewrite to avoid the need for strcat, typically by using stpcpy
and/or lispstpcpy.  strcat tends to be part of O(N**2) algorithms.
* src/doc.c (sibling_etc):
* src/xrdb.c (xdefaults):
Now a top-level static constant.
2014-12-25 15:44:23 -08:00
Paul Eggert
73bfe891e2 Omit redundant extern decls.
Most of this patch is from Dmitry Antipov, in:
http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00263.html
* configure.ac (WERROR_CFLAGS): Add -Wredundant-decls.
* lib-src/emacsclient.c (getenv): Remove decl.
* lib-src/make-docfile.c (write_globals): Add ATTRIBUTE_CONST for
Fbyteorder, Ftool_bar_height, Fmax_char, Fidentity.
* lwlib/lwlib-Xm.c (lw_motif_widget_p, xm_update_one_value)
(xm_create_dialog, xm_destroy_instance, xm_popup_menu)
(xm_set_keyboard_focus, xm_set_main_areas): Remove decls.
* src/commands.h (update_mode_lines):
* src/frame.h (Qbackground_color, Qforeground_color)
(x_set_menu_bar_lines):
* src/ftfont.c (ftfont_font_format):
* src/intervals.h (Qkeymap, Qfont):
* src/keyboard.c (timer_check, safe_run_hooks, Qregion_extract_function):
* src/lisp.h (Ffboundp, Qnil, Qt, Qlambda, Qintegerp, Qwholenump)
(Qsymbolp, Qlisp, Qconsp, Qstringp, Qarrayp, Qbufferp, Qmarkerp)
(Qvectorp, Qbuffer_or_string_p, Qchar_table_p, Qvector_or_char_table_p)
(Qfloatp, Qnumberp, Qfont_spec, Qfont_entity, Qfont_object)
(Fbyteorder, wrong_type_argument, Fmax_char, syms_of_composite)
(Fidentity, extract_float, init_display, syms_of_display, Qdisplay):
(Qimage, Qbox, redisplay_preserve_echo_area, char_table_ref)
(char_table_set, char_table_translate, Qautoload, Qbottom, Qtop)
(Qvisible, Qfont, Qfront_sticky, Qrear_nonsticky, init_sigio)
(Qtool_bar, Qheader_line):
* src/macros.c (Fexecute_kbd_macro):
* src/xdisp.c (Ftool_bar_height, Ftool_bar_height):
* src/xterm.c (x_delete_terminal, XSetIMValues):
* src/xterm.h (x_set_window_size, x_query_color, x_get_focus_frame)
(x_implicitly_set_name, popup_activated)
(widget_store_internal_border):
Remove redundant decls.
* src/frame.c [USE_X_TOOLKIT]: Include widget.h.
* src/keyboard.c (Fexit_recursive_edit, Fabort_recursive_edit):
Remove _Noreturn, as make-docfile now does that for us.
* src/lisp.h (DEFUN): Don't declare fnname here; rely on make-docfile.
(Qregion_extract_function): New decl.
* src/window.c, src/xfns.c: Include menu.h.
2014-06-17 09:09:19 -07:00
Paul Eggert
d355cad6b7 Handle systems without WCONTINUED consistently.
* lib-src/emacsclient.c (WCONTINUED): Move to ../src/syswait.h.
* src/process.c (handle_child_signal): Remove WCONTINUED ifdef,
because WCONTINUED is always defined now.
* src/syswait.h (WCONTINUED): Move here from ../lib-src/emacsclient.c.

Fixes: debbugs:15110 debbugs:17339
2014-05-03 13:13:10 -07:00
Juanma Barranquero
f11352e68b lib-src/emacsclient.c (main): #ifdef out previous change on Windows. 2014-03-10 01:09:30 +01:00
Paul Eggert
d050de754c Fix emacsclient terminal corruption when in background.
* emacsclient.c (handle_sigcont): Check for tcgetpgrp failure.
Cancel the continue only if tty.  Send SIGTTIN to the process
group, not SIGSTOP to self, as this is what the glibc manual
recommends.
(main): If tty, and if started in the background, send SIGTTIN
to the process group.

Fixes: debbugs:16892
2014-03-09 15:38:15 -07:00
Paul Eggert
591debed68 Fix emacsclient's handling of SIGCONT.
* emacsclient.c (handle_sigcont): Cancel the continue only if tty.

Fixes: debbugs:16883
2014-02-25 11:06:53 -08:00
Paul Eggert
ba3189039a Update copyright year to 2014 by running admin/update-copyright. 2014-01-01 07:43:34 +00:00
Paul Eggert
96c0686368 Use bool for boolean, focusing on headers.
* configure.ac (PTY_OPEN, GC_MARK_SECONDARY_STACK):
Use bool for boolean.
* lib-src/emacsclient.c, lib-src/etags.c, lib-src/hexl.c (FALSE, TRUE):
Remove.  All uses replaced with uncapitalized version.
* lib-src/emacsclient.c (message):
* lib-src/etags.c (make_tag, pfnote, consider_token, make_C_tag, lang_names):
* lib-src/hexl.c (un_flag, iso_flag, endian):
* lib-src/pop.c (pop_debug, pop_open, pop_multi_first, pop_multi_next)
(pop_trash):
Use bool for boolean.
* lib-src/etags.c (bool): Remove.
* lib-src/etags.c (globals, members, declarations, no_line_directive)
(no_duplicates): Use 'int' for boolean values that getopt requires
to be 'int'.  Formerly, these were 'bool' and 'bool' was 'int',
but we can no longer rely on this implementation.
* lib-src/pop.h (struct _popserver): Use bool_bf for boolean bit-fields.
* lwlib/xlwmenuP.h (XlwMenu_part): Use bool_bf for boolean bit-fields.
* src/atimer.h, src/lisp.h, src/syssignal.h, src/syswait.h, src/unexelf.c:
No need to include <stdbool.h>, since conf_post.h does it now.
* src/buffer.h (BUF_COMPUTE_UNCHANGED, DECODE_POSITION)
(BUFFER_CHECK_INDIRECTION, GET_OVERLAYS_AT, PER_BUFFER_VALUE_P)
(SET_PER_BUFFER_VALUE_P):
* src/ccl.c, src/ccl.h (setup_ccl_program):
* src/ccl.h (CHECK_CCL_PROGRAM):
* src/character.h (MAKE_CHAR_UNIBYTE, CHECK_CHARACTER_CAR)
(CHECK_CHARACTER_CDR, CHAR_STRING_ADVANCE, NEXT_CHAR_BOUNDARY)
(PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE)
(FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE)
(FETCH_STRING_CHAR_ADVANCE_NO_CHECK, FETCH_CHAR_ADVANCE)
(FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, INC_BOTH)
(DEC_BOTH, BUF_INC_POS, BUF_DEC_POS):
* src/charset.h (CHECK_CHARSET, CHECK_CHARSET_GET_ID)
(CHECK_CHARSET_GET_ATTR, CHECK_CHARSET_GET_CHARSET)
(CHARSET_FAST_MAP_SET):
* src/coding.c (decode_coding_ccl, encode_coding_ccl):
* src/coding.h (CHECK_CODING_SYSTEM, CHECK_CODING_SYSTEM_GET_SPEC)
(CHECK_CODING_SYSTEM_GET_ID, SJIS_TO_JIS, SJIS_TO_JIS2)
(JIS_TO_SJIS, JIS_TO_SJIS2, ENCODE_FILE, DECODE_FILE)
(ENCODE_SYSTEM, DECODE_SYSTEM, ENCODE_UTF_8)
(decode_coding_c_string):
* src/composite.h (COMPOSITION_DECODE_REFS, COMPOSITION_DECODE_RULE):
* src/conf_post.h (has_attribute):
* src/dispextern.h (trace_redisplay_p):
(INC_TEXT_POS, DEC_TEXT_POS, SET_GLYPH_FROM_GLYPH_CODE)
(SET_CHAR_GLYPH, SET_CHAR_GLYPH_FROM_GLYPH)
(SET_GLYPH_FROM_CHAR_GLYPH):
(WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P)
(FACE_SUITABLE_FOR_ASCII_CHAR_P, FACE_SUITABLE_FOR_CHAR_P)
(PRODUCE_GLYPHS, reset_mouse_highlight, in_display_vector_p)
(cursor_in_mouse_face_p):
* src/dispnew.c (adjust_glyph_matrix, clear_glyph_matrix_rows)
(blank_row, prepare_desired_row)
(build_frame_matrix_from_leaf_window, make_current)
(mirror_make_current, mirrored_line_dance, mirror_line_dance)
(update_window, scrolling_window, update_frame_line):
* src/disptab.h (GLYPH_FOLLOW_ALIASES):
* src/editfns.c (Fformat):
* src/font.h (FONT_WEIGHT_SYMBOLIC, FONT_SLANT_SYMBOLIC)
(FONT_WIDTH_SYMBOLIC, FONT_WEIGHT_FOR_FACE, FONT_SLANT_FOR_FACE)
(FONT_WIDTH_FOR_FACE, FONT_WEIGHT_NAME_NUMERIC)
(FONT_SLANT_NAME_NUMERIC, FONT_WIDTH_NAME_NUMERIC)
(FONT_SET_STYLE, CHECK_FONT, CHECK_FONT_SPEC, CHECK_FONT_ENTITY)
(CHECK_FONT_OBJECT, CHECK_FONT_GET_OBJECT, FONT_ADD_LOG)
(FONT_DEFERRED_LOG):
* src/frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_WINDOW_P):
(FRAME_EXTERNAL_TOOL_BAR, FRAME_EXTERNAL_MENU_BAR, FOR_EACH_FRAME)
(FRAME_MOUSE_UPDATE):
* src/fringe.c (Fdefine_fringe_bitmap):
* src/image.c (x_create_bitmap_from_data, x_create_bitmap_mask)
(x_create_bitmap_from_xpm_data, xpm_load_image):
* src/intervals.h (INTERVAL_HAS_PARENT, INTERVAL_PARENT)
(set_interval_parent, RESET_INTERVAL, COPY_INTERVAL_CACHE)
(MERGE_INTERVAL_CACHE):
* src/keymap.h (KEYMAPP):
* src/lisp.h (eassert, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE)
(STRING_SET_UNIBYTE, STRING_SET_MULTIBYTE, DEFSYM, PSEUDOVECTORP)
(CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER)
(CHECK_NUMBER_COERCE_MARKER, CHECK_NUMBER_OR_FLOAT_COERCE_MARKER)
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
(DEFVAR_BUFFER_DEFAULTS, DEFVAR_KBOARD, QUIT)
(RETURN_UNGCPRO, USE_SAFE_ALLOCA, SAFE_NALLOCA, SAFE_FREE)
(SAFE_ALLOCA_LISP, FOR_EACH_ALIST_VALUE, functionp):
* src/syntax.h (SYNTAX_ENTRY, SYNTAX_WITH_FLAGS, SYNTAX)
(UPDATE_SYNTAX_TABLE_FORWARD, UPDATE_SYNTAX_TABLE_BACKWARD)
(SETUP_BUFFER_SYNTAX_TABLE):
* src/systime.h (timespec_valid_p):
* src/term.c (save_and_enable_current_matrix):
* src/window.h (WINDOW_MENU_BAR_P, WINDOW_TOOL_BAR_P):
* src/xdisp.c (in_display_vector_p, display_tool_bar_line)
(redisplay_internal, try_window_reusing_current_matrix)
(sync_frame_with_window_matrix_rows, try_window_id)
(display_menu_bar, display_tty_menu_item, display_mode_line)
(coords_in_mouse_face_p, cursor_in_mouse_face_p):
* src/xmenu.c (xmenu_show):
* src/xterm.c (use_xim, x_term_init):
* src/xterm.h (XSync, GTK_CHECK_VERSION, use_xim, SET_SCROLL_BAR_X_WIDGET)
(struct x_bitmap_record):
Use bool for booleans.
* src/ccl.c (struct buffer_text):
* src/ccl.h (struct ccl_program):
* src/charset.h (struct charset):
* src/cm.h (struct cm):
* src/coding.h (struct iso_2022_spec, struct coding_system):
* src/dispextern.h (struct glyph, struct glyph_matrix, struct glyph_row)
(struct glyph_string, struct face, struct face_cache)
(struct bidi_string_data, struct bidi_it)
(struct draw_fringe_bitmap_params, struct it, Mouse_HLInfo)
(struct image):
* src/editfns.c (Fformat):
* src/frame.h (struct frame):
* src/fringe.c (struct fringe_bitmap):
* src/intervals.h (struct interval):
* src/keyboard.h (struct kboard):
* src/lisp.h (struct Lisp_Symbol, struct Lisp_Misc_Any, struct Lisp_Marker)
(struct Lisp_Overlay, struct Lisp_Save_Value, struct Lisp_Free)
(struct Lisp_Buffer_Local_Value, union specbinding):
* src/macfont.m (struct macfont_info):
* src/process.h (struct Lisp_Process):
* src/termchar.h (struct tty_display_info):
* src/window.h (struct window):
* src/xterm.h (struct x_output):
Use bool_bf for boolean bit-fields.
* src/ccl.c (setup_ccl_program): Now returns bool instead of -1 or 0.
All callers changed.
* src/ccl.h (struct ccl_program): Remove unused members private_state,
src_multibyte, dst_multibyte, cr_consumed, suppress_error,
eight_bit_control.
(struct ccl_spec): Remove unused members cr_carryover,
eight_bit_carryover.
* src/conf_post.h: Include <stdbool.h>.
(bool_bf): New type.
* src/dispextern.h (TRACE, PREPARE_FACE_FOR_DISPLAY):
* src/interval.h (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE)
Surround statement macro with proper 'do { ... } while (false)' brackets.
(SET_MATRIX_ROW_ENABLED_P): Assume 2nd arg is bool.
(PRODUCE_GLYPHS): Simplify use of boolean.
* src/fileio.c (Fcopy_file):
If I is an integer, prefer 'if (I != 0)' to 'if (I)'.
* src/lisp.h (UNGCPRO): Return void, not int.
(FOR_EACH_TAIL): Use void expression, not int expression.
* src/region-cache.c: Reindent.
* src/region-cache.h: Copy comments from region-cache.c, to fix
incorrect remarks about booleans.
2013-12-14 13:36:44 -08:00
Paul Eggert
29abe551a0 Port to C89.
* lib-src/ebrowse.c (USAGE): Remove macro with too-long string literal ...
(usage_message): ... and replace it with this new static constant
containing multiple literals.  All uses changed.
* lib-src/emacsclient.c (print_help_and_exit):
Rewrite to avoid string literals longer than the C89 limits.
(start_daemon_and_retry_set_socket):
Rewrite to avoid non-constant array initializer.
* lib-src/make-docfile.c (enum global_type): Omit trailing comma.
* src/bytecode.c (BYTE_CODE_THREADED): Do not define if __STRICT_ANSI__.
(B__dummy__): New dummy symbol, to pacify C89.
* src/dbusbind.c (XD_DEBUG_MESSAGE): Omit debugging on C89 hosts, since
they can't grok varargs macros.
* src/dispnew.c (add_window_display_history)
(add_frame_display_history):
* src/print.c (print_object):
* src/xdisp.c (debug_method_add):
Use %p printf format only for void pointers.
* src/emacs.c (usage_message): New constant, replacing ...
(USAGE1, USAGE2, USAGE3): Remove; they were too long for C89.
(main): Adjust to usage reorg.
* src/fns.c (syms_of_fns):
* src/profiler.c (syms_of_profiler):
Don't use non-constant struct initializers.
* src/gnutls.h (gnutls_initstage_t):
* src/lisp.h (enum Lisp_Fwd_Type):
* src/lread.c (lisp_file_lexically_bound_p):
* src/xsettings.c (anonymous enum):
Remove trailing comma.
* src/xsettings.c (apply_xft_settings): Use %f, not %lf; %lf is a C99ism.
* src/lisp.h (ENUM_BF): Use unsigned if pedantic.
(DEFUN_FUNCTION_INIT): New macro, that falls back on a cast if pre-C99.
(DEFUN): Use it.
* src/regex.c (const_re_char): New type, to pacify strict C89.
All uses of 'const re_char' replaced to use it.
* src/regex.h (_Restrict_): Rename from __restrict, to avoid clash
with glibc when strict C89.  This change is imported from gnulib.
All uses changed.
(_Restrict_arr_): Rename from __restrict_arr, similarly.
* src/sysdep.c (time_from_jiffies) [!HAVE_LONG_LONG_INT]:
Omit GNU_LINUX implementation, since it requires long long.
* src/xterm.c (x_draw_underwave):
Do not assume the traditional order of struct's members.
(x_term_init): Rewrite to avoid the need for non-constant structure
initializers.
2013-07-10 16:23:57 -07:00
Paul Eggert
47d7532e09 File synchronization fixes.
* admin/CPP-DEFINES (BSD_SYSTEM, HAVE_FSYNC): Remove.
* admin/merge-gnulib (GNULIB_MODULES): Add fsync, fdatasync.
* configure.ac (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
(fsync): Remove check; now done by gnulib.
* lib/fdatasync.c, lib/fsync.c, m4/fdatasync.m4, m4/fsync.m4:
New files, from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib-src/Makefile.in (LIB_FDATASYNC): New macro.
(emacsclient${EXEEXT}): Use it.
* lib-src/emacsclient.c (main): Use fdatasync, not fsync, since we don't
care about metadata.  Keep trying if interrupted.
* lib-src/movemail.c (main, popmail): Don't worry about BSD_SYSTEM, since
fsync is available everywhere (or there is a substitute).  Don't
report an error if fsync returns EINVAL.
* nt/inc/ms-w32.h (fdatasync): New macro, suggested by Eli Zaretskii.
* src/Makefile.in (LIB_FDATASYNC): New macro.
(LIBES): Use it.
* src/conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
* src/fileio.c (Fwrite_region, write_region_inhibit_fsync):
Don't worry about HAVE_FSYNC, since a substitute fsync is
available if the system lacks one.
(Fwrite_regin): Retry fsync if interrupted.

Fixes: debbugs:13944
2013-03-13 11:42:22 -07:00
Paul Eggert
0877d0dc24 Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.ca 2013-01-02 08:13:04 -08:00
Paul Eggert
ab422c4d68 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
Paul Eggert
9239d97052 Assume POSIX 1003.1-1988 or later for unistd.h.
* admin/CPP-DEFINES (BROKEN_GETWD, HAVE_GETCWD, HAVE_GETWD, HAVE_SIZE_T)
(HAVE_UNISTD_H): Remove.
* configure.ac: Do not check for getcwd or getwd.
* lib-src/emacsclient.c (getcwd): Remove decl.
(get_current_dir_name): Assume getcwd exists.
* lib-src/etags.c (HAVE_GETCWD): Remove.
(getcwd): Remove decl.
(NO_LONG_OPTIONS): Remove this.  All uses removed.
Emacs always has GNU getopt.
(etags_getcwd): Assume getcwd exists.
* lib-src/movemail.c (F_OK, X_OK, W_OK, R_OK): Remove.
* nt/config.nt (HAVE_GETCWD): Remove.
* src/alloc.c: Assume unistd.h exists.
* src/fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
* src/sysdep.c (get_current_dir_name): Assume getcwd exists.
(getwd) [USG]: Remove; no longer needed.
(sys_subshell) [DOS_NT]: Use getcwd, not getwd.
* src/w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
* src/w32.h (getcwd): Remove decl.

Fixes: debbugs:12945
2012-11-21 13:06:52 -08:00
Paul Eggert
a7db35b378 * emacsclient.c (handle_sigcont, handle_sigtstp): Use raise (sig)
rather than kill (getpid (), sig), as it's simpler and safer.
2012-11-20 00:31:19 -08:00
Daniel Colascione
efc3dd3ccc Detect window-system from display name 2012-09-17 03:55:05 -08:00
Daniel Colascione
6b59694eac Add alt_display to emacsclient for w32, ns 2012-09-17 03:55:04 -08:00
Daniel Colascione
5e0944c6f0 Fix emacsclient to work with cygw32 2012-09-17 03:55:03 -08:00
Paul Eggert
b69a6d2284 Rely on <unistd.h> to declare 'environ',
as gnulib does this if the system doesn't.
* lib-src/emacsclient.c (environ): Remove decl.
* src/callproc.c, src/editfns.c, src/process.c (environ) [!USE_CRT_DLL]:
* src/emacs.c (environ) [DOUG_LEA_MALLOC]:
* src/vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
* src/vm-limit.c: Include <unistd.h>, for 'environ'.
2012-08-19 14:00:09 -07:00
Glenn Morris
25e65510a3 Move IF_LINT from lisp.h to conf_post.h
* src/conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
* src/lisp.h (IF_LINT, lint_assume): Move to conf_post.h.

* lib-src/make-docfile.c (IF_LINT):
* lib-src/emacsclient.c (IF_LINT): Remove (in config.h now).
2012-08-10 14:23:45 -04:00
Glenn Morris
9374581a24 Move DIRECTORY_SEP from lisp.h to config.h
* configure.ac (DIRECTORY_SEP): Move here from src/lisp.h.

* src/lisp.h (DIRECTORY_SEP): Let configure set it.

* nt/config.nt (DIRECTORY_SEP): Move here from src/lisp.h.

* lib-src/movemail.c (DIRECTORY_SEP, IS_DIRECTORY_SEP):
* lib-src/make-docfile.c (DIRECTORY_SEP, IS_DIRECTORY_SEP):
* lib-src/emacsclient.c (DIRECTORY_SEP, IS_DIRECTORY_SEP, IS_DEVICE_SEP):
Remove (they are in config.h now).
2012-08-09 20:02:10 -04:00
Paul Eggert
5ebbef1dc0 Assume strerror. 2012-07-10 22:44:06 -07:00
Juanma Barranquero
ad0a19b70e lib-src/emacsclient.c (w32_execvp): Declare execvp to silence the compiler. 2012-07-09 16:01:41 +02:00
Juanma Barranquero
794327722e lib-src/emacsclient.c: Adapt comments to GNU coding standards. 2012-07-09 16:00:31 +02:00
Paul Eggert
845ca89390 Switch from NO_RETURN to C11's _Noreturn.
Fixes: debbugs:11750
2012-06-24 10:39:14 -07:00
Samuel Bronson
dd1ff7c09a * emacsclient.c (set_local_socket): Fix a compiler warning.
Fixes: debbugs:7838
2012-06-24 17:43:09 +08:00
Juanma Barranquero
069a7756f7 lib-src/emacsclient.c (min): Undef before redefining it. 2012-05-02 13:33:49 +02:00
Jim Meyering
1e6f32f816 * lib-src/emacsclient.c (send_to_emacs): Avoid invalid strcpy
upon partial send.

Fixes: debbugs:11374
2012-05-02 18:41:27 +08:00
Chong Yidong
2d0e8e614a Fix emacsclient/server behavior under --without-x.
* lib-src/emacsclient.c (main): Send -tty to Emacs under more circumstanced (Bug#8314).

* lisp/server.el (server-process-filter): Only try to open a window
system frame if compiled with graphical support (Bug#8314).

Fixes: debbugs:11102
2012-04-20 18:37:57 +08:00
Chong Yidong
9a864fa27d Move "emacsclient -t -n" handling from emacsclient.c to server.el.
Fix its buggy logic for the Windows case (regression from 23.4).

* lib-src/emacsclient.c (decode_options): Move -t -n corner case handling
into server.el.

* lisp/server.el (server-process-filter): Handle corner case where both
tty and nowait options are present.

Fixes: debbugs:11102
2012-04-15 16:49:24 +08:00
Juanma Barranquero
9401b32679 lib-src/emacsclient.c (decode_options) [WINDOWSNT]: Fix typo in 2011-12-04T17:13:01Z!lekktu@gmail.com.
Call ttyname instead of passing its address.
2012-04-12 20:22:06 +02:00
Andreas Schwab
e29ab36b48 Define -print-nonl client command
* lib-src/emacsclient.c (main): Handle -print-nonl command.

* lisp/server.el (server-msg-size): New constant.
(server-reply-print): New function.
(server-eval-and-print): Use it.
(server-eval-at): Use server-quote-arg and server-unquote-arg.
Handle -print-nonl.
2012-03-11 18:53:07 +01:00
Andreas Schwab
2b84f674cc * emacsclient.c (main): Handle multiple messages in a single
datagram.
2012-03-11 12:49:59 +01:00
Andreas Schwab
6b0c89847a Don't access freed memory in emacsclient
* emacsclient.c (socket_name): Add const.
(get_server_config): Add parameter config_file, use it instead of
global server_file.
(set_tcp_socket): Add parameter local_server_file, pass it down to
get_server_config.
(set_local_socket): Add parameter local_socket_name, use it
instead of global socket_name.
(set_socket): Adjust calls to set_local_socket and set_tcp_socket.
Don't clobber global server_file or socket_name.
(main): No longer reset server_file or socket_name.
2012-03-11 12:15:25 +01:00
Glenn Morris
acaf905b11 Add 2012 to FSF copyright years for Emacs files 2012-01-05 01:46:05 -08:00
Juanma Barranquero
520fca41d6 Fix emacsclient bug where "-n -c" does not open a new frame on Windows.
* lib-src/emacsclient.c (decode_options) [WINDOWSNT]: Don't force tty = 0;
instead, treat both -c and -t as always requesting a new "tty" frame,
and let server.el decide which kind is actually required.
Reported by Uwe Siart <usenet@siart.de> in this thread:
http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00303.html

* lisp/server.el (server-delete-client): On Windows, do not try to delete
the only terminal.
(server-process-filter): On Windows, treat requests for a tty frame as
if they were for a GUI frame if the running server is in GUI mode.
2011-12-04 18:13:01 +01:00
Chong Yidong
7ebc1f135e Fix typo in comment. 2011-11-30 23:43:33 +08:00
Chong Yidong
e7308292aa * emacsclient.c (main): Condition last change on WINDOWSNT (Bug#10155). 2011-11-30 16:13:05 +08:00
Eli Zaretskii
8c9afb4694 Fix MS-Windows build with MSVC compiler.
Parts of the changes by Fabrice Popineau  <fabrice.popineau@supelec.fr>.

 lib-src/makefile.w32-in (LOCAL_FLAGS): Add $(EMACS_EXTRA_C_FLAGS).
 lib-src/emacsclient.c (main) <environ>: Remove declaration, already
 pulled in by unistd.h on Posix hosts and stdlib.h on MS-Windows.
 nt/inc/stdint.h (uint32_t, uint64_t) [_WIN64]: New typedefs.
 (UINT64_MAX) [_WIN64]: Fix definition.
 (uintmax_t, intmax_t): Fix definitions.
 nt/inc/inttypes.h (strtoumax, strtoimax) [!__MINGW32__]: Provide
 correct definitions.
 nt/config.nt (HAVE_DECL_STRTOLL): Define.
 (va_copy) [_WIN64]: Provide a better definition.
 src/s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
 (snprintf) [_MSC_VER]: Redirect to _snprintf.
 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
 (malloc, free, realloc, calloc): Redirect to e_* only when
 compiling Emacs.
 src/lisp.h (GCTYPEBITS): Move before first use.
 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
 this macro definition.
 (tzname): Redirect to _tzname for all values of _MSC_VER.

Fixes: debbugs:9960
2011-11-27 20:52:53 +02:00
Paul Eggert
8350f087ef Spelling fixes. 2011-11-14 12:23:26 -08:00
Juanma Barranquero
657d08d30a src/image.c, src/w32*.c, lib-src/emacsclient.c: Silence warnings under -Wall. 2011-10-27 02:59:21 +02:00
Paul Eggert
17107bb698 Integer and memory overflow issues.
* emacsclient.c (xmalloc): Accept size_t, not unsigned int, to
avoid potential buffer overflow issues on typical 64-bit hosts.
Return void *, not long *.
(get_current_dir_name): Report a failure, instead of looping
forever, if buffer size calculation overflows.  Treat malloc
failures like realloc failures, as that has better behavior and is
more consistent.  Do not check whether xmalloc returns NULL, as
that's not possible.
(message): Do not arbitrarily truncate message to 2048 bytes when
sending it to stderr; use vfprintf instead.
(get_server_config, set_local_socket)
(start_daemon_and_retry_set_socket): Do not alloca
arbitrarily-large buffers; that's not safe.
(get_server_config, set_local_socket): Do not use sprintf when its
result might not fit in 'int'.
(set_local_socket): Do not assume uid fits in 'int'.
2011-08-28 16:52:34 -07:00
Jason Rumney
bc92abd282 * lib-src/emacsclient.c (decode_options) [WINDOWSNT]: Avoid tty mode on
Windows.

Fixes: debbugs:5486
2011-07-02 23:07:57 +08:00
Glenn Morris
a150502ad8 * lib-src/emacsclient.c (print_help_and_exit): More fixing of previous. 2011-06-25 12:52:34 -07:00
Glenn Morris
5f9388d04e * lib-src/emacsclient.c (print_help_and_exit): Fix previous change. 2011-06-25 12:33:07 -07:00
Glenn Morris
3794a2d3a4 Minor additions for previous emacsclient change.
* lib-src/emacsclient.c (decode_options) <opt>: Add `F:'.
(print_help_and_exit): Mention --frame-parameters.
2011-06-25 11:13:14 -07:00
Andreas Rottmann
18a4ce5ea1 Allow emacsclient to set parameters of new graphical frames (bug#5864)
* lib-src/emacsclient.c (longopts, decode_options, main): Add frame-parameters.

* lisp/server.el (server-create-window-system-frame): Add parameters arg.
(server-process-filter): Doc fix.  Handle frame-parameters.

* doc/emacs/misc.texi (emacsclient Options): Mention --frame-parameters.
* doc/man/emacsclient.1: Mention --frame-parameters.

* etc/NEWS: Mention this.
2011-06-25 11:05:48 -07:00
Dan Nicolaescu
fe91f5a091 * lib-src/emacsclient.c (socket_status): Use constant pointer. 2011-06-01 10:15:27 -07:00
Paul Eggert
c5443aa547 * emacsclient.c (main): Don't use uninitialized var.
(IS_ANY_SEP): Remove; unused.
(get_current_dir_name): Add an extern decl.
2011-04-16 14:11:28 -07:00
Paul Eggert
72b04a8a97 * emacsclient.c (message): Mark it as a printf-like function. 2011-04-05 12:59:58 -07:00
Glenn Morris
9af30bdf17 Remove (RET)SIGTYPE; it is identical to void on all supported systems.
Ref: http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg01068.html

* configure.in (AC_TYPE_SIGNAL): Remove obsolete macro.
(AH_BOTTOM): Do not define SIGTYPE.

* lib-src/emacsclient.c: Replace SIGTYPE with void.

* nt/config.nt: Remove RETSIGTYPE, SIGTYPE (identical to void).

* src/syssignal.h: Replace RETSIGTYPE with void.

* src/atimer.c, src/data.c, src/dispnew.c, src/emacs.c, src/floatfns.c:
* src/keyboard.c, src/keyboard.h, src/lisp.h, src/process.c, src/sysdep.c:
* src/xterm.c: Replace SIGTYPE with void everywhere.

* src/s/template.h (SIGTYPE): Remove commented out definition.
* src/s/usg5-4-common.h (SIGTYPE): Remove definition.

* admin/CPP-DEFINES: Remove SIGTYPE.
2011-03-26 19:27:11 -07:00
Drake Wilson
0b973fc594 Add --quiet option for emacsclient (bug#663) (tiny change)
* lib-src/emacsclient.c (longopts): Add quiet.
(decode_options): Handle q/quiet.
(print_help_and_exit): Add q/quiet.
(main): Suppress some messages if quiet option is used.

* doc/emacs/misc.texi (emacsclient Options): Add q/quiet.
2011-03-02 23:00:23 -08:00
Eli Zaretskii
a54af40e14 Fix the MS-Windows build after 2011-02-26T05:54:36Z!eggert@cs.ucla.edu.
emacsclient.c (xstrdup) [WINDOWSNT]: Function added back.
 (w32_getenv): Use xstrdup to return all values in malloc'ed
 storage.
2011-02-26 09:44:38 +02:00
Paul Eggert
4be3dfc5e3 * emacsclient.c (IF_LINT): New macro.
(set_local_socket, main): Use it to suppress warnings with
GCC -Wuninitialized.
2011-02-25 16:17:02 -08:00
Paul Eggert
b9170155fb * emacsclient.c (xstrdup): Remove; no longer needed.
(get_current_dir_name, w32_getenv, get_server_config, find_tty):
(set_local_socket, main):
Use const char *, not char *, for pointers that are not assigned
through.
2011-02-25 15:55:06 -08:00
Paul Eggert
7e6bb4c94c * emacsclient.c (main): Avoid dangling 'if'. 2011-02-25 15:39:18 -08:00
Paul Eggert
b0bbc07d9a * emacsclient.c: Redo local variables to avoid shadowing problems.
(message, socket_status, start_daemon_and_retry_set_socket):
Rename locals.
(main): Move decl of "i".
2011-02-25 15:35:16 -08:00
Paul Eggert
b23b5a5b7d Declare file-scope functions and variables static if not exported.
This is more consistent, and is nicer with gcc -Wstrict-prototypes.
* ebrowse.c, emacsclient.c, fakemail.c, make-docfile.c, movemail.c:
* profile.c, test-distrib.c, update-game-score.c:
Declare non-'main' functions and variables to be static.
* ebrowse.c: Omit redundant function prototypes.
2011-02-21 10:06:25 -08:00
Karl Chen
b166dcd8bb * lib-src/emacsclient.c (main): Loop while `recv' return EINTR. 2011-02-18 17:28:09 -05:00
Paul Eggert
03fc768bf7 * emacsclient.c: conform to C89 pointer rules 2011-02-04 23:18:46 -08:00
Glenn Morris
73b0cd5003 Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
Paul Eggert
a3e44e7937 Merge from mainline. 2011-01-17 11:01:01 -08:00
Glenn Morris
0d9f702fd0 Nuke arch-tags. 2011-01-15 15:16:57 -08:00
Paul Eggert
8a1f4a98c1 Merge from mainline. 2011-01-14 10:14:17 -08:00
Stefan Monnier
77ab81d054 Merge from emacs-23 2011-01-14 12:18:41 -05:00
Paul Eggert
4004364e67 Include <unistd.h> unilaterally. 2011-01-09 00:12:35 -08:00
Paul Eggert
613f7bda1d Include <getopt.h> not "getopt.h".
* ebrowse.c, emacsclient.c: Include <getopt.h>, not "getopt.h".
Since getopt.h is no longer in this directory, there's no point
using the form with double-quotes.
2011-01-09 00:00:02 -08:00
Glenn Morris
5df4f04cd3 Add 2011 to FSF/AIST copyright years. 2011-01-02 15:50:46 -08:00
Stefan Monnier
4a47c27573 Merge from emacs-23 2010-11-17 22:54:14 -05:00
YAMAMOTO Mitsuharu
e6068ab302 Add fall-back definition of _CS_DARWIN_USER_TEMP_DIR (fix last failed check-in). 2010-11-10 17:35:27 +09:00
Juanma Barranquero
4628bef1ee Merge changes from emacs-23 branch. 2010-10-08 12:14:47 +02:00
Dan Nicolaescu
728a982db4 Fix compilation warnings.
* lib-src/test-distrib.c (cool_read):
* lib-src/movemail.c (main, concat):
* lib-src/make-docfile.c (scan_file, write_c_args):
* emacsclient.c	(get_server_config): Fix -Wconversion warning.
(egetenv): Move conditional definition earlier.
(progname): Use const.
* lib-src/sorted-doc.c (xstrdup): Use const.
2010-10-03 16:35:22 -07:00
Wolfgang Schnerring
3ecb8d931a * emacsclient.c (main): Return EXIT_FAILURE if Emacs sends us an error string
(Bug#6963).
2010-10-02 20:00:01 -04:00
Glenn Morris
b336bfcdf3 Close bug#3992.
* lib-src/emacsclient.c (set_local_socket) [DARWIN_OS]: Try as a fall-back
DARWIN_USER_TEMP_DIR.
2010-09-30 20:41:12 -07:00
Juanma Barranquero
968ef9b4da lisp/server.el: Use just one way to pass the Emacs PID to emacsclient.
* lib-src/emacsclient.c (get_server_config): Don't read Emacs pid from
  the authentication file.

* lisp/server.el (server-start): Don't write pid to the authentication file.
  (server-create-tty-frame): Don't send pid.
  (server-process-filter): Send pid at the start of every connection.
2010-09-30 04:53:26 +02:00
Juanma Barranquero
6ab88e02c9 * emacsclient.c (main): Remove unused variables.
(start_daemon_and_retry_set_socket): Use EXIT_FAILURE.
2010-09-29 10:18:40 +02:00
Jan D
988e88ab11 Fix warnings produced by compiling with -Wwrite_strings (i.e. use const char *).
* b2m.c (concat, fatal): Use const char*.
(main): Don't assign labels a string literal.

* ebrowse.c (struct member): filename, def_filename is const.
(struct sym): filename, sfilename is const.
(struct kw): name is const.
(add_sym, yyerror, token_string, insert_keyword, main): Use const char*.

* emacsclient.c (message, sock_err_message, send_to_emacs)
(quote_argument, set_local_socket)
(start_daemon_and_retry_set_socket): Use const char*.

* etags.c (compressor, language, Ada_suffix, Ada_help, Asm_suffixes)
(Asm_help, default_C_suffixes, default_C_help, Cplusplus_suffixes)
(Cplusplus_help, Cjava_suffixes, Cobol_suffixes, Cstar_suffixes)
(Erlang_suffixes, Erlang_help, Forth_suffixes, Forth_help)
(Fortran_suffixes, Fortran_help, HTML_suffixes,  HTML_help)
(Lisp_suffixes, Lisp_help, Lua_suffixes, Lua_help)
(Makefile_filenames, Makefile_help, Objc_suffixes, Objc_help)
(Pascal_suffixes, Pascal_help, Perl_suffixes, Perl_interpreters)
(Perl_help, PHP_suffixes, PHP_help, plain_C_suffixses, PS_suffixes)
(PS_help, Prolog_suffixes, Prolog_help, Python_suffixes, Python_help)
(Scheme_suffixes, Scheme_help, TeX_suffixes, TeX_help, Texinfo_suffixes)
(Texinfo_help, Yacc_suffixes, Yacc_help, auto_help, none_help)
(no_lang_help, print_language_names)
(get_language_from_interpreter, get_language_from_filename)
(init, make_tag, struct C_stab_entry, write_classname, TEX_defenv)
(TEX_decode_env, nocase_tail, savestr, savenstr, fatal, pfatal)
(concat): Use const char*.

* make-docfile.c (error, fatal, scan_c_file, scan_lisp_file): Use
const char *.

* movemail.c (fatal, error, concat): Use const char *.

* pop.c (pop_multi_first, socket_connection, sendline): Use conat char*.

* pop.h (pop_multi_first): Use const char *.
(_ARGS): Remove.

* sorted-doc.c (error, fatal, states): Use const char *.

* update-game-score.c (get_prefix, write_scores, main): Use const char*.
2010-08-11 10:20:34 +02:00
Dan Nicolaescu
0613f5d515 emacsclient.c cleanups.
* lib-src/emacsclient.c: Move socket related #includes together with the
rest of the #includes.  Move a WINDOWSNT includes closer together.
(HAVE_CONFIG_H): Remove.
(NO_RETURN): Remove, defined in config.h.
(main): Convert definition to standard C.
2010-08-05 21:09:54 -07:00
Juanma Barranquero
35a7804dae * emacsclient.c (getcwd): Fix previous change.
Make getcwd conditional on HAVE_GETCWD and declare with the
  correct POSIX profile (for some reason MinGW headers define
  its 2nd arg as int, not size_t; but getcwd is not used on
  Windows nonetheless).
2010-07-25 05:36:54 +02:00
Juanma Barranquero
361358ea12 Make building under stricter warning flags somewhat cleaner.
Flags used: -Wold-style-declaration -Wunused-function -Wstrict-prototypes

* lib-src/emacsclient.c (getcwd, w32_getenv):
* lib-src/ntlib.h (getlogin, getuid, getegid, getgid): Fix prototypes.

* nt/runemacs.c (set_user_model_id): Fix prototype.

* src/callproc.c (relocate_fd): Set inside #ifndef WINDOWSNT.
* src/dired.c (opendir, readdir): Fix prototypes.
* src/editfns.c (w32_get_internal_run_time): Fix prototypes.
* src/keyboard.c (input_available_signal): Declare inside #ifdef SIGIO.
* src/ndir.h (opendir, readdir, seekdir, closedir): Fix prototypes.
  (telldir): Remove declaration.
* src/ralloc.c (real_morecore, __morecore): Fix prototypes.
* src/sound.c (alsa_sound_perror): Declare inside #ifdef HAVE_ALSA.
* src/syssignal.h (strsignal): Fix prototype.
* src/term.c (tparam): Fix prototype.
  (term_get_fkeys_address, term_get_fkeys_kboard, term_get_fkeys_1)
  (term_get_fkeys): Set inside "#ifndef DOS_NT".
* src/vm-limit.c (check_memory_limits): Fix prototypes of real_morecore
  and __morecore.
* src/w32gui.h (XParseGeometry): Fix prototype.
* src/w32heap.h (get_data_start, get_data_end, init_heap): Fix prototypes.
* src/w32term.c (my_set_focus): Declare inside #if 0.
* src/w32term.h (x_window_to_frame, x_display_info_for_name, w32_term_init)
  (w32_fill_rect, w32_clear_window, init_crit, delete_crit, signal_quit)
  (drain_message_queue, get_next_msg, post_msg, parse_button)
  (ClipboardSequence_Proc): Fix prototypes.
  (wait_for_sync): Remove declaration.
2010-07-25 02:20:51 +02:00
Dan Nicolaescu
68441b90e9 Add NO_RETURN specifiers to functions in lib-src.
* lib-src/update-game-score.c (usage):  Add NO_RETURN specifier.
* lib-src/movemail.c (fatal, pfatal_with_name, pfatal_and_delete):
* lib-src/make-docfile.c (fatal):
* lib-src/hexl.c (usage):
* lib-src/fakemail.c (fatal):
* lib-src/etags.c (fatal, suggest_asking_for_help, pfatal):
* lib-src/emacsclient.c (fatal):
* lib-src/b2m.c (fatal): Likewise.
2010-07-24 10:18:18 -07:00
Juanma Barranquero
7c3320d8b9 Convert some more functions to standard C.
* lib-src/emacsclient.c (get_current_dir_name, w32_get_resource)
  (w32_getenv, w32_set_user_model_id, w32_window_app, w32_execvp)
  (close_winsock, initialize_sockets, w32_find_emacs_process)
  (w32_give_focus):
* lib-src/ntlib.c (getlogin, getuid, getgid, getegid):
* nt/addpm.c (add_registry, main):
* nt/cmdproxy.c (get_env_size):
* nt/ddeclient.c (main):
* nt/runemacs.c (set_user_model_id):
* src/alloc.c (emacs_blocked_free, emacs_blocked_malloc)
  (emacs_blocked_realloc, uninterrupt_malloc):
* src/fringe.c (w32_reset_fringes):
* src/image.c (convert_mono_to_color_image, lookup_rgb_color)
  (init_color_table, XPutPixel, jpeg_resync_to_restart_wrapper):
* src/sound.c (be2hs, do_play_sound):
* src/vm-limit.c (get_lim_data, ret_lim_data):
* src/w32term.c (x_free_frame_resources):
* src/xfaces.c (x_create_gc, x_free_gc):
  Convert definitions to standard C.
2010-07-20 22:21:03 +02:00
Andreas Schwab
8966b7575b Use strchr, strrchr instead of index, rindex
* callint.c (Fcall_interactively): Use strchr, strrchr instead of
index, rindex.
* doc.c (get_doc_string, Fsnarf_documentation): Likewise.
* editfns.c (Fuser_full_name, Fformat): Likewise.
* emacs.c (argmatch, sort_args, decode_env_path): Likewise.
* fileio.c (Ffile_symlink_p): Likewise.
* filelock.c (current_lock_owner): Likewise.
* font.c (font_parse_name, font_parse_family_registry): Likewise.
* fontset.c (fontset_pattern_regexp): Likewise.
* lread.c (read1): Likewise.
* sysdep.c (init_system_name): Likewise.
* xfns.c (select_visual): Likewise.
* s/hpux10-20.h (index, rindex): Don't define.
* s/ms-w32.h (index): Likewise.
* s/usg5-4.h: Likewise.

* sed2v2.inp (HAVE_INDEX, HAVE_RINDEX): Don't edit.
(HAVE_STRCHR, HAVE_STRRCHR): Edit to 1.

* emacsclient.c (set_local_socket): Use strchr, strrchr instead of
index, rindex.
* movemail.c (mail_spool_name, popmail): Likewise.
* pop.c (pop_list): Likewise.

* CPP-DEFINES (HAVE_INDEX, HAVE_RINDEX): Remove.

* configure.in: Don't check for index and rindex, check for strchr
and strrchr.  Define strchr and strrchr as index and rindex,
resp., in src/config.h if not available.
2010-07-11 12:31:10 +02:00
Juanma Barranquero
3a35a84c93 Fix prototypes.
* src/cm.c (evalcost): Fix arg type.
* src/cm.h (evalcost): Fix prototype.
* src/lisp.h (memory_warnings): Fix prototype.

* lib-src/ebrowse.c (match_qualified_namespace_alias):
  Pass sym* to find_namespace, not link*.
* lib-src/emacsclient.c (send_to_emacs, quote_argument): Arg s is HSOCKET.
* lib-src/sorted-doc.c (qsort_compare): New typedef.
  (main): Use it to cast cmpdoc.
2010-07-03 09:44:17 +02:00
Dan Nicolaescu
873fbd0b84 Convert function definitions to standard C.
* lib-src/update-game-score.c: Convert function definitions to standard C.
* lib-src/sorted-doc.c:
* lib-src/profile.c:
* lib-src/pop.c:
* lib-src/movemail.c:
* lib-src/make-docfile.c:
* lib-src/hexl.c:
* lib-src/fakemail.c:
* lib-src/etags.c:
* lib-src/ebrowse.c:
* lib-src/digest-doc.c:
* lib-src/b2m.c: Likewise.
2010-07-02 17:50:23 -07:00
Chong Yidong
0191e222e3 Add --parent-id argument to emacsclient.
* lib-src/emacsclient.c (longopts, decode_options, print_help_and_exit):
New arg `-parent-id'.
(main): Send parent-id to Emacs.

* lisp/server.el (server-process-filter): Receive parent-id argument
from emacsclient.
(server-create-window-system-frame): New arg.  Pass parent-id as
frame parameter.
2010-05-29 19:50:47 -04:00
Dan Nicolaescu
42a2c62292 Remove extern errno declarations.
* xterm.c:
* xrdb.c:
* w32term.c:
* unexec.c:
* unexaix.c:
* sysdep.c:
* process.c:
* lread.c:
* keyboard.c:
* floatfns.c:
* filelock.c:
* fileio.c:
* emacs.c (main):
* ecrt0.c:
* dispnew.c:
* callproc.c:
* buffer.c: Remove errno extern declarations.
* s/netbsd.h (NEED_ERRNO): Remove.

* movemail.c:
* etags.c:
* emacsclient.c: Remove extern errno declarations.
2010-04-01 20:10:33 -07:00
Juanma Barranquero
768c0c0f39 Fix typos in comments and ChangeLogs. 2010-01-13 16:38:28 +01:00
Glenn Morris
114f9c9679 Add 2010 to copyright years. 2010-01-13 00:35:10 -08:00
Glenn Morris
5f54cae6cc (print_help_and_exit): Fix bug report instructions. 2009-10-15 06:11:57 +00:00
Jason Rumney
0a3472c7b9 * w32term.c (w32_initialize): Use standard types.
* runemacs.c (set_user_model_id): Use standard types.
* emacsclient.c (w32_set_user_model_id): Use standard types.
2009-07-03 15:32:02 +00:00
Jason Rumney
ff90fbdecc bug#1849 - Windows 7 Taskbar Support
* w32term.c (w32_initialize): Use GetModuleHandle for library that
is already loaded.
Set user model ID if supported (bug#1849).

* runemacs.c (set_user_model_id): New function.
(WinMain): Use it.

* emacsclient.c (w32_give_focus): Use GetModuleHandle for library
that is already loaded.
(w32_set_user_model_id): New function.
(main): Use it to associate emacsclient with emacs (bug#1849).
2009-06-30 15:48:23 +00:00
Juanma Barranquero
9dfda22f23 * emacsclient.c (print_help_and_exit): Fix typo and tabify (careful
spacing is required in the message output, as the comment suggests).
2009-04-20 03:19:19 +00:00
Chong Yidong
24d5010d9f * emacsclient.c (print_help_and_exit): Clarify argument placement
for short option names.
2009-04-20 02:52:56 +00:00
Dan Nicolaescu
6133a1a9b7 (print_help_and_exit): Fix typo. 2009-04-02 19:43:27 +00:00
Juanma Barranquero
6cde1b2138 * emacsclient.c (main): Revert part of last change,
so drive-relative file names again work on Windows.
2009-03-11 00:57:03 +00:00
Stefan Monnier
ba528748a1 * server.el (server-process-filter): Use expand-file-name rather than
command-line-normalize-file-name so as to use the `dir' when provided.
* emacsclient.c (main): Always pass cwd via "-dir".  Pass the file
names without prepending cwd to them, so Emacs uses its customary
rules to determine how to interpret the file name.
2009-03-10 14:08:52 +00:00
Adrian Robert
e7534fc4ed * emacsclient.c (decode_options): Use a dummy display name under NS/Cocoa. 2009-01-23 09:08:03 +00:00
Glenn Morris
f5d0ac07d6 Add 2009 to copyright years. 2009-01-08 03:38:51 +00:00
Dan Nicolaescu
fd95644b93 * emacs.c (main): Print and error and exit when no data is read
from the pipe.

* startup.el (command-line): Do not mention the server name in
case the user has not mentioned it, print a more explicit message.

* emacsclient.c (start_daemon_and_retry_set_socket): Improve error
checking.
2008-12-18 08:48:26 +00:00
Dan Nicolaescu
67c1df0180 Include syswait.h instead of sys/types.h. 2008-12-14 03:23:43 +00:00
Dan Nicolaescu
5445ab06ef (WCONTINUED): New compatibility define for older systems. 2008-12-11 17:32:44 +00:00
Dan Nicolaescu
d50299d55d (main): Fix previous change. 2008-12-10 23:36:03 +00:00
Juanma Barranquero
5201664703 * emacsclient.c (main): Fix mindless breakage where emacsclient
does not work *at all* on Windows, even if it *can* connect.
2008-12-10 22:18:21 +00:00
Dan Nicolaescu
45ce457074 (main): Fail in case of not being able to connect. 2008-12-10 15:24:22 +00:00
Dan Nicolaescu
69157c9960 (decode_options): Fix typo. 2008-12-10 15:07:56 +00:00
Dan Nicolaescu
802bdb3c6b (EMACS_DAEMON): Remove definition.
(decode_options): Do not allow an empty alternate_editor on
WINDOWSNT.
(print_help_and_exit): Replace EMACS_DAEMON with WINDOWSNT.
(start_daemon_and_retry_set_socket): Likewise.
2008-12-10 14:57:20 +00:00
Juanma Barranquero
c3f995a2cb * emacsclient.c [!WINDOWSNT] (EMACS_DAEMON): New define.
Changes when EMACS_DAEMON is not defined:
  (print_help_and_exit): Don't add daemon information to help.
  (start_daemon_and_retry_set_socket): Make a no-op.
  (main): Don't set `start_daemon_if_needed' (which is initialized to 0).
2008-12-10 09:47:06 +00:00
Dan Nicolaescu
636b507bcc * misc.texi (emacsclient Options): Describe what an empty string
argument does for --alternate-editor.

* emacsclient.1: Describe what an empty string argument does for
--alternate-editor.

* emacsclient.c (print_help_and_exit): Describe what an empty
string argument does for --alternate-editor.
(set_socket): Make it possible to not exit in case of an error.
(start_daemon_and_retry_set_socket): New function.
(main): Use it.  Restore the NULL value for socket_name and
server_file after the set_socket call.
2008-12-10 07:56:51 +00:00
Dan Nicolaescu
18d2ad2920 Fix typo in include. 2008-12-03 04:33:44 +00:00
Dan Nicolaescu
448d408588 Include <darpa/inet.h>. 2008-12-03 03:37:37 +00:00
Chong Yidong
a336ee5bc0 Fix last change. 2008-11-02 23:16:33 +00:00
Chong Yidong
273b902863 (window_system): Delete redundant variable.
(decode_options): Don't use it.
(find_tty): New function.
(main): Use find_tty, and don't use window_system.
2008-11-02 21:41:57 +00:00
Eli Zaretskii
d41784eef4 (main) [WINDOWSNT]: Don't ifdef away the call to `ttyname'.
(w32_getenv): Treat $TERM specially: if not found in the environment and in
the Registry, return "w32console".
(ttyname) [WINDOWSNT]: New function.
2008-11-01 13:49:23 +00:00
Andreas Schwab
322ca65006 (main): Don't force sending tty when in eval mode. 2008-10-31 23:17:13 +00:00
Chong Yidong
8536c0f5c5 (main): If using the current frame, send tty information to Emacs in
case daemon mode needs to occupy this tty.
2008-10-30 15:54:38 +00:00
Juanma Barranquero
bc558f3edb * emacsclient.c (EXTRA_SPACE): New macro.
(get_server_config, set_local_socket): Use it.
2008-10-29 15:34:06 +00:00
Juanma Barranquero
f77b11a051 * server.el, emacsclient.c: Use TMPDIR (default /tmp) instead of hardcoded /tmp. 2008-10-29 10:42:31 +00:00
Dan Nicolaescu
dc1cd5f755 (longopts, print_help_and_exit): Add -nw.
(decode_options): Use getopt_long_only.
2008-10-13 02:32:51 +00:00
Eli Zaretskii
c966fd27a1 (main): Fix a typo in a comment. 2008-09-19 16:45:12 +00:00
Chong Yidong
d5dabcb513 (main): Use stdout rather than stdin to obtain the terminal (bug#427). 2008-09-19 15:50:24 +00:00
Dan Nicolaescu
7c2fb837ec * bitmaps/README:
* xfns.c:
* termcap.c:
* term.c:
* syswait.h:
* systty.h:
* systime.h:
* syssignal.h:
* sysdep.c:
* process.h:
* process.c:
* print.c:
* ndir.h:
* lread.c:
* keyboard.c:
* getpagesize.h:
* floatfns.c:
* fileio.c:
* emacs.c:
* doc.c:
* dispnew.c:
* dired.c:
* data.c:
* callproc.c:
* buffer.c:
* README:
* Makefile.in:
* s/template.h:
* s/msdos.h:
* m/vax.h: Remove VMS support.
* s/vms.h:
* vlimit.h:
* uaf.h:
* temacs.opt:
* param.h:
* ioctl.h: Remove file.

* descrip.mms:
* compile.com: Remove file.
* Create.c: Remove VMS support.

* message.el (Module):

* gnus-start.el (Module):

* gnus-registry.el (Module):

* textmodes/texinfmt.el:
* nxml/nxml-enc.el:
* mail/feedmail.el:
* international/mule.el:
* international/latexenc.el:
* emulation/viper-util.el:
* emulation/viper-init.el:
* emulation/viper-ex.el:
* emacs-lisp/bytecomp.el:
* version.el:
* subr.el:
* startup.el:
* sort.el:
* shadowfile.el:
* recentf.el:
* printing.el:
* paths.el:
* minibuffer.el:
* ls-lisp.el:
* loadup.el:
* hippie-exp.el:
* finder.el:
* files.el:
* ediff-util.el:
* ediff-ptch.el:
* ediff-init.el:
* ediff-diff.el:
* dired.el:
* dired-aux.el:
* cus-edit.el:
* bindings.el:
* arc-mode.el:
* add-log.el: Remove VMS support.
* obsolete/vmsproc.el:
* obsolete/vms-pmail.el:
* obsolete/vms-patch.el: Remove file.

* etags.c:
* emacsclient.c: Remove VMS support.

* termcap.src: Remove file.
* README:
* PROBLEMS:
* MACHINES: Remove VMS info.

* ediff.texi: Remove VMS support.

* os.texi:
* intro.texi:
* files.texi: Remove VMS support.

* emacs.texi: Remove VMS support.

* make-dist:
* README: Remove VMS support.
* vms: Remove directory.
2008-07-31 05:33:56 +00:00
Dan Nicolaescu
9e2a264775 Remove support for Mac Carbon.
* mactoolbox.c:
* macterm.h:
* macterm.c:
* macselect.c:
* macmenu.c:
* macgui.h:
* macfns.c:
* mac.c: Remove file.
* s/darwin.h:
* m/intel386.h:
* xfaces.c:
* xdisp.c:
* window.c:
* tparam.c:
* termhooks.h:
* termcap.c:
* term.c:
* syssignal.h:
* sysselect.h:
* sysdep.c:
* process.c:
* lread.c:
* lisp.h:
* keyboard.c:
* image.c:
* fringe.c:
* frame.h:
* frame.c:
* fontset.c:
* font.h:
* font.c:
* fns.c:
* fileio.c:
* emacs.c:
* dispnew.c:
* dispextern.h:
* config.in:
* atimer.c:
* Makefile.in: Remove code for Carbon

* erc.el: Remove code for Carbon.

Remove support for Mac Carbon.
* term/mac-win.el: Remove file
* international/mule-cmds.el:
* version.el:
* startup.el:
* simple.el:
* mwheel.el:
* mouse.el:
* loadup.el:
* isearch.el:
* info.el:
* frame.el:
* faces.el:
* disp-table.el:
* cus-start.el:
* cus-face.el:
* cus-edit.el:
* Makefile.in: Remove code for Carbon.

Remove support for Mac Carbon.
* makefile.w32-in:
* emacsclient.c: Remove code for Carbon.

* PROBLEMS:
* MACHINES: Remove mentions of Mac Carbon.

* ns-emacs.texi:
* faq.texi: Remove mentions of Mac Carbon.

* os.texi:
* frames.texi:
* display.texi: Remove mentions of Mac Carbon.

* xresources.texi: Remove mentions of Mac Carbon.

* make-tarball.txt:
* admin.el:
* FOR-RELEASE:
* CPP-DEFINES: Remove mentions of Mac Carbon.

Remove support for Mac Carbon.
* mac: Remove directory.
* make-dist:
* configure.in:
* README:
* Makefile.in:
* INSTALL:  Remove code for Carbon.
* configure: Regenerate.
2008-07-27 18:24:48 +00:00
Glenn Morris
294981c77c Switch to recommended form of GPLv3 permissions notice. 2008-05-09 23:19:13 +00:00
Dan Nicolaescu
9d2818d676 * configure.in: Remove references to obsolete variables and
systems.
* configure: Regenerate.

* Makefile.in (NO_SHORTNAMES):
* emacsclient.c (NO_SHORTNAMES):
* fakemail.c (NO_SHORTNAMES):
* make-docfile.c (NO_SHORTNAMES):
* movemail.c (NO_SHORTNAMES):
* pop.c (NO_SHORTNAMES): Remove references to obsolete variable.

* config.nt (SHORTNAMES): Remove reference to obsolete variable.

* s/vms4-0.h:
* s/vms4-2.h:
* s/vms4-4.h:
* s/vms5-5.h: Remove, unused.

* s/irix5-2.h:
* s/irix6-0.h:
* s/riscos5.h:
* s/mach-bsd4-3.h:
* m/mips4.h: Remove files for obsolete systems

* Makefile.in:
* filelock.c:
* unexmips.c:
* m/hp9000s300.h:
* m/iris4d.h:
* s/aix3-1.h:
* s/hpux.h:
* s/msdos.h:
* s/usg5-0.h:
* s/usg5-2-2.h:
* s/usg5-2.h:
* s/usg5-3.h: Remove references to obsolete variables.

* s/irix5-0.h: Remove, move all the contents ...
* s/irix6-5.h: ... here.  Simplify.
* config.in: Regenerate.
2008-02-24 18:53:07 +00:00
Juanma Barranquero
31e25350a8 Fix typo in comment. 2008-02-20 12:09:38 +00:00
Juanma Barranquero
50f271cb5a (main) [WINDOWSNT]: Understand DRIVE:NAME, where
NAME is relative to DRIVE'S current directory.
2008-02-20 12:06:52 +00:00
Juanma Barranquero
d07529f330 (print_help_and_exit): Show -d option on Windows. 2008-02-15 16:59:19 +00:00
Stefan Monnier
09317bf4bf (decode_options): Fix last change so as not to override an explicit -display. 2008-02-08 15:28:04 +00:00
Stefan Monnier
9997dc1529 (decode_options): Pass --display implicitly if -c
is specified.  Only set tty if -t or -c is specified.
2008-02-08 15:25:58 +00:00
Stefan Monnier
0ea5797a18 (decode_options): Default to a NULL display, as Emacs-22.
Allow the -d option under w32 again, for those rare cases where it
actually does make sense.
2008-01-26 21:27:38 +00:00
Juanma Barranquero
5ab7322861 (set_tcp_socket): Don't send a "\n" after the authentication string;
there's no need to haste.
2008-01-25 15:46:07 +00:00