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

252 Commits

Author SHA1 Message Date
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