summaryrefslogtreecommitdiff
path: root/lib-src
Commit message (Collapse)AuthorAgeFilesLines
* Rework C source files to avoid ^(Paul Eggert2016-03-1012-29/+27
| | | | | | | | 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.
* By default, etags produces unqualified Perl tag namesEli Zaretskii2016-03-101-6/+21
| | | | | | | | | | | | | | | | * lib-src/etags.c (Perl_functions): Produce unqualified names, unless -Q was specified. (print_help): Update the description of -Q. * doc/man/etags.1: Update the documentation of -Q. * test/etags/ETAGS.good_1: * test/etags/ETAGS.good_2: * test/etags/ETAGS.good_3: * test/etags/ETAGS.good_4: * test/etags/ETAGS.good_5: * test/etags/CTAGS.good: Adapt the expected test results to the changed Perl functionality.
* Make the code in movemail_strftime more generalEli Zaretskii2016-03-061-1/+28
| | | | | | * lib-src/movemail.c (movemail_strftime): Transform the format string passed by the caller instead of using a separate format string.
* Restore leading space in movemail pop outputPaul Eggert2016-03-051-1/+19
| | | | | | | | | * lib-src/movemail.c (movemail_strftime) [WINDOWSNT]: New function. (strftime) [WINDOWSNT]: New macro. (mbx_delimit_begin): Go back to previous version of this code, now that there’s a special-purpose WINDOWSNT implementation that should do the right thing. That way, the output continues to use leading space rather than leading zero for day of month.
* Fix mbox files produced by movemail on MS-WindowsEli Zaretskii2016-03-051-1/+1
| | | | | | * lib-src/movemail.c (mbx_delimit_begin): Use portable strftime format specifiers, as at least the MS-Windows version of strftime doesn't support %e and %T.
* * lib-src/pop.c (socket_connection): Fix format string.Andreas Schwab2016-02-271-1/+1
|
* * lib-src/make-docfile.c: Include stdarg.h.Paul Eggert2016-02-111-0/+1
|
* make-docfile cleanup for I/O, etc.Paul Eggert2016-02-101-90/+110
| | | | | | | | | | | | | | | | | | | | | * lib-src/make-docfile.c (progname, generate_globals, num_globals) (num_globals_allocated, globals): Now static. (generate_globals, struct rcsoc_state, read_c_string_or_comment): (write_c_args, scan_c_stream, search_lisp_doc_at_eol, scan_lisp_file): Use bool for boolean. (verror): New function. (fatal, error): Use it. API is now like printf. All callers changed. (main): Remove err_count local that was always 0. (main, scan_c_stream, scan_lisp_file): Check for I/O error. (scan_file, scan_c_file, scan_c_stream, scan_lisp_file): Return void, not 0. (put_char, scan_keyword_or_put_char, scan_c_file): Use char for byte. (scan_keyword_or_put_char): Check for missing ( and unexpected EOF. (close_emacs_globals): Use ptrdiff_t for index, not int. (scan_c_file, scan_lisp_file): Exit with failure if file cannot be opened, rather than diagnosing but exiting with status 0. (search_lisp_doc_at_eol): Don't worry about ungetc of EOF; it's portable now.
* Memory-management cleanup in make-docfilePaul Eggert2016-02-101-57/+75
| | | | | | | | | | | | | | | | | | | | | | I compiled it with -fsanitize=address and fixed the leaks it detected. Also, I changed it to prefer signed to unsigned integer types, and to check for integer overflow. * lib-src/make-docfile.c: Include <stddef.h>, <stdint.h>, <intprops.h>, <min-max.h>. (memory_exhausted): New function. (xmalloc, xrealloc): Use it. (xmalloc, xrealloc, scan_file, struct rcsoc_state, write_c_args) (uncompiled, scan_lisp_file): Prefer signed integer types to unsigned. (xstrdup): Remove. All uses removed. (num_globals, num_globals_allocated, write_globals, scan_c_stream): Use ptrdiff_t, not int, for indexes that in theory could exceed INT_MAX. (add_global): Use const to pacify --enable-gcc-warnings. Make a copy here, rather than relying on strdup calls later. (add_global, write_globals, scan_c_stream): Avoid integer overflow when calculating sizes. (write_globals, scan_c_stream, scan_lisp_file): Avoid memory leak. (scan_c_stream): Check for add_global failure.
* Extend etags Ruby support for accessorsEli Zaretskii2016-02-061-1/+5
| | | | | | | | | | | | | | | * lib-src/etags.c (Ruby_functions): Support accessors defined with parentheses. (Bug#22563) * test/etags/ruby-src/test1.ru (A::B): Add tests for accessors defined with parentheses. * test/etags/ETAGS.good_1: * test/etags/ETAGS.good_2: * test/etags/ETAGS.good_3: * test/etags/ETAGS.good_4: * test/etags/ETAGS.good_5: * test/etags/ETAGS.good_6: * test/etags/CTAGS.good: Adapt to changes in Ruby tests.
* Minor fix in tagging Ruby accessors by etagsEli Zaretskii2016-02-041-2/+3
| | | | | * lib-src/etags.c (Ruby_functions): Don't tag accessors whose names are not literal symbols. (Bug#22241)
* Etags: yet another improvement in Ruby tagsEli Zaretskii2016-02-031-24/+53
| | | | | | | | | | | | | | | * lib-src/etags.c (Ruby_functions): Handle continuation lines in Ruby accessor definitions. (Bug#22241) * test/etags/ruby-src/test1.ru (A::B#X): Add some more tests for accessors and multiline definitions. * test/etags/ETAGS.good_1: * test/etags/ETAGS.good_2: * test/etags/ETAGS.good_3: * test/etags/ETAGS.good_4: * test/etags/ETAGS.good_5: * test/etags/ETAGS.good_6: * test/etags/CTAGS.good: Adapt to changes in Ruby tags.
* Fix names of tags generated for Ruby accessorsEli Zaretskii2016-02-021-0/+2
| | | | | | | | | | | | | * lib-src/etags.c (Ruby_functions): Don't include the leading colon ':' in tags for Ruby accessors and aliases. (Bug#22241) * test/etags/ETAGS.good_1: * test/etags/ETAGS.good_2: * test/etags/ETAGS.good_3: * test/etags/ETAGS.good_4: * test/etags/ETAGS.good_5: * test/etags/ETAGS.good_6: * test/etags/CTAGS.good: Adapt to changes in Ruby tags.
* Fix file-name recognition in 'etags'Eli Zaretskii2016-02-021-0/+8
| | | | | | | | | | | | | | | | | * lib-src/etags.c (get_language_from_filename): If FILE includes a leading directory, compare only its basename to the known file names in lang_names[]. * test/etags/Makefile (RBSRC): Adapt to recent test1.ruby renaming. * test/etags/ETAGS.good_1: * test/etags/ETAGS.good_2: * test/etags/ETAGS.good_3: * test/etags/ETAGS.good_4: * test/etags/ETAGS.good_5: * test/etags/ETAGS.good_6: * test/etags/CTAGS.good: Adapt to changes in Ruby file names and to the results in Makefile due to the above etags.c fix.
* Change Ruby file names and extensions recognized by 'etags'Eli Zaretskii2016-02-021-2/+4
| | | | | | | | | * lib-src/etags.c <Ruby_filenames>: New variable, holds names of Ruby files. <Ruby_suffixes>: Treat .rb, .ru, and .rbw as Ruby extensions. <lang_names>: Add Ruby_filenames to the Ruby entry. * test/etags/ruby-src/test1.ru: Renamed from test1.ruby. (Bug#22241)
* More improvements for Ruby support in 'etags'Eli Zaretskii2016-02-021-2/+56
| | | | | | | | | | | | | | | | * lib-src/etags.c (Ruby_functions): Tag Ruby accessors and alias_method. Identify constants even if the assignment is not followed by whitespace. (Bug#22241) * test/etags/ruby-src/test1.ruby: Add tests for constants, accessors, and alias_method. * test/etags/ETAGS.good_1: * test/etags/ETAGS.good_2: * test/etags/ETAGS.good_3: * test/etags/ETAGS.good_4: * test/etags/ETAGS.good_5: * test/etags/ETAGS.good_6: * test/etags/CTAGS.good: Adapt to changes in Ruby tests.
* Support Go language in 'etags'lu4nx2016-01-301-1/+74
| | | | | | | | | | | | | | | | | | | | | | | | | * lib-src/etags.c <Ruby_help>: Fix documentation of Ruby tags. <Go_help>: New help. <Go_suffixes>: New variable. (Go_functions): New function. <lang_names>: Add entry for Go. (Bug#22370) * doc/emacs/maintaining.texi (Tag Syntax): Document Go support. * doc/man/etags.1: Mention Go support. * etc/NEWS: Mention Go support. * test/etags/go-src/test.go: * test/etags/go-src/test1.go: New test files. * test/etags/Makefile (GOSRC): New variable. (SRCS): Add $(GOSRC). * test/etags/ETAGS.good_1: * test/etags/ETAGS.good_2: * test/etags/ETAGS.good_3: * test/etags/ETAGS.good_4: * test/etags/ETAGS.good_5: * test/etags/ETAGS.good_6: * test/etags/CTAGS.good: Adapt to addition of Go tests.
* Improve Ruby support in 'etags'Eli Zaretskii2016-01-301-4/+54
| | | | | | | | | | | | | | | | | | | | | * lib-src/etags.c (Ruby_functions): Tag constants. Don't tag singleton classes. Remove class qualifiers from tags generated for method and constant names. (Bug#22241) * doc/emacs/maintaining.texi (Tag Syntax): Mention that constants are tagged by etags in Ruby. * etc/NEWS: Mention that constants are tagged by etags in Ruby. * test/etags/ruby-src/test1.ruby: Add more tests. * test/etags/ETAGS.good_1: * test/etags/ETAGS.good_2: * test/etags/ETAGS.good_3: * test/etags/ETAGS.good_4: * test/etags/ETAGS.good_5: * test/etags/ETAGS.good_6: * test/etags/CTAGS.good: Adapt to the changes in etags and in Ruby tests.
* Port "$@" to OpenIndiana ksh93Paul Eggert2016-01-241-2/+2
| | | | | | | | | In http://lists.gnu.org/archive/html/bug-autoconf/2015-12/msg00000.html Pavel Raiskup reports that ${1+"$@"} runs afoul of a bug in /bin/sh (derived from ksh 93t+ 2010-03-05). ${1+"$@"} works around an ancient bug in long-dead shells, so remove the workaround. * admin/check-doc-strings, configure.ac, lib-src/rcs2log: Use plain "$@" rather than ${1+"$@"}.
* Unhide the --no-line-directive option to 'etags'Eli Zaretskii2016-01-151-2/+1
| | | | | | | * lib-src/etags.c (print_help): Un-undocument the --no-line-directive option. (Bug#22306) * doc/man/etags.1: Document the --no-line-directive option.
* Fix copyright years by handPaul Eggert2016-01-011-1/+1
| | | | | These are dates that admin/update-copyright did not update, or updated incorrectly.
* Update copyright year to 2016Paul Eggert2016-01-0115-15/+15
| | | | Run admin/update-copyright.
* Remove SunOS 4.x cruftPaul Eggert2015-12-181-4/+0
| | | | | | Support for SunOS 4.x was removed in Emacs 23 but some cruft was left behind. * lib-src/pop.c [sun]: Remove no-longer-needed include. * lwlib/xlwmenu.c (SUNSO41): Remove.
* Improve Lua support in etagsEli Zaretskii2015-12-111-0/+1
| | | | | | | | | | | | | | | | | * lib-src/etags.c (Lua_functions): Skip spaces before looking for "function". * etc/NEWS: Mention improved Lua support by 'etags'. * test/etags/lua-src/test.lua (test): Add tests for indented function definitions. * test/etags/ETAGS.good_1: * test/etags/ETAGS.good_2: * test/etags/ETAGS.good_3: * test/etags/ETAGS.good_4: * test/etags/ETAGS.good_5: * test/etags/ETAGS.good_6: * test/etags/CTAGS.good: Adapt to the modified Lua tests.
* Improve and document Ruby support in 'etags'Eli Zaretskii2015-12-111-7/+11
| | | | | | | | | | | | | | | | | | | | | * lib-src/etags.c (Ruby_suffixes): Add ".ruby". (Ruby_functions): Support "module" and overloaded operators. (Ruby_help): Mention "module". * test/etags/ruby-src/test.rb: * test/etags/ruby-src/test1.ruby: New files. * test/etags/Makefile (RBSRC): New tests. (SRCS): Add ${RBSRC}. * test/etags/ETAGS.good_1: * test/etags/ETAGS.good_2: * test/etags/ETAGS.good_3: * test/etags/ETAGS.good_4: * test/etags/ETAGS.good_5: * test/etags/ETAGS.good_6: * test/etags/CTAGS.good: Adapt to the new Ruby tests. * doc/man/etags.1: Mention Ruby support. * etc/NEWS: Mention Ruby support.
* Initial support for Ruby in 'etags'Xi Lu2015-12-111-0/+33
| | | | | | * lib-src/etags.c <Ruby_suffixes>: New variable. (lang_names): Add an entry for Ruby. (Ruby_functions): New function. (Bug#22116)
* Fix Lua tags when a function name includes '.' or ':'Eli Zaretskii2015-11-281-1/+16
| | | | | * lib-src/etags.c (Lua_functions): Add a tag for the last element of a function name after a dot or a colon. (Bug#21934)
* Spelling fixesPaul Eggert2015-10-211-1/+1
|
* Unmacroize ebrowse.c and etags.c a bitPaul Eggert2015-10-122-39/+72
| | | | | | | | | | | | | * lib-src/ebrowse.c (READ_CHUNK_SIZE): Now an enum constant. (streq, filename_eq, set_flag, has_flag): Now inline functions. (set_flag): First arg is now an address, not an lvalue. All callers changed. (filename_eq, set_flag, has_flag): Rename from FILENAME_EQ, SET_FLAG, HAS_FLAG. All callers changed. * lib-src/etags.c (streq, strcaseeq, strneq, strncaseeq): Now inline functions. Remove asserts that are unnecessary these days (and in some cases were too-generous anyway).
* Use ‘echo’ safely with ‘\’ or leading ‘-’Paul Eggert2015-10-101-9/+11
| | | | | | | | | | | | | | | | | | | | | | POSIX says that ‘echo FOO’ produces implementation-defined output if FOO contains leading ‘-’, or ‘\’ anywhere, so don’t assume GNU behavior in that case. * Makefile.in (removenullpaths): Remove. (epaths-force): Rewrite to avoid the need for ‘echo’. (install-etc): Be clearer about escaping the shell metacharacters ‘\’ and ‘$’. * Makefile.in (install-arch-indep, install-etcdoc): * admin/charsets/mapconv, admin/merge-gnulib, admin/merge-pkg-config: * admin/quick-install-emacs, build-aux/gitlog-to-emacslog: * configure.ac, lib-src/rcs2log, make-dist: * src/Makefile.in (lisp.mk): Don’t assume ‘echo’ outputs ‘\’ and leading ‘-’ unscathed. For example, use ‘printf '%s\n' "$foo"’ rather than ‘echo "$foo"’ if $foo can contain arbitrary characters. * lisp/Makefile.in (TAGS): Use ‘ls’, not ‘echo’, to avoid ‘\’ issues. * doc/lispref/two-volume.make (vol1.pdf): * test/etags/make-src/Makefile (web ftp publish): Use ‘printf’ rather than ‘echo -e’.
* Minor quoting fixes in scripts and docPaul Eggert2015-09-161-9/+9
| | | | | | Prefer straight quotes in random script files, as they are not converted. Prefer grave quotes in a couple of places in the manual that were missed earlier, as these quotes are converted.
* Add -Wswitch to --enable-gcc-warningsPaul Eggert2015-09-161-2/+40
| | | | | | | | | | | | | | | | | | | | | | Make --enable-gcc-warnings a bit pickier, by also using -Wswitch. * configure.ac (WERROR_CFLAGS): Don’t add -Wno-switch. * lib-src/etags.c (main, consider_token, C_entries): * src/coding.c (encode_invocation_designation): * src/data.c (Ftype_of): * src/eval.c (Fdefvaralias, default_toplevel_binding) (Fbacktrace__locals, mark_specpdl): * src/lisp.h (record_xmalloc): * src/syntax.c (scan_lists, scan_sexps_forward): * src/window.c (window_relative_x_coord): * src/xdisp.c (push_it, pop_it): * src/xterm.c (xg_scroll_callback, x_check_fullscreen): Error out or do nothing (as appropriate) if a switch statement with an enum value does not cover all of the enum. * src/dispextern.h (struct iterator_stack_entry.u.comp): Remove unused member discovered by using -Wswitch. * src/lisp.h (record_xmalloc): Add a ‘+ 0’ to pacify -Wswitch. * src/vm-limit.c (check_memory_limits): Simplify warning-diagnostic computation by using a table.
* etags ‘fatal’ function is now printf-likePaul Eggert2015-09-161-11/+21
| | | | | | | * lib-src/etags.c (fatal): Now printf-like. All callers changed. Also, now static; not clear why it needed to be extern. (verror): New function, with most of the old contents of ‘error’. (fatal, error): Use it.
* Prefer straight quoting in some text filesPaul Eggert2015-09-111-4/+4
| | | | | | | | | Mostly this just changes ` to ' in static text. Some exceptions: * INSTALL.REPO: Use curved quotes, as the diagnostic in question typically does that now. * admin/quick-install-emacs (TRY, top level): Use straight quoting in diagnostics. * src/README: Fix working-directory confusion.
* Refix movemail GCC pacificationPaul Eggert2015-09-091-5/+2
| | | | | | Problem reported by Ken Brown in: http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00406.html * lib-src/movemail.c (main): Fix previous change.
* Port movemail to RHEL 6 with --enable-gcc-warningsPaul Eggert2015-09-091-2/+4
| | | | * lib-src/movemail.c (main): Declare local only if needed.
* Use straight quotes in lib-src diagnosticsPaul Eggert2015-08-274-62/+62
| | | | | | | | | | | | | | | 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.
* * admin/admin.el (set-version, set-copyright): Remove deleted files.Glenn Morris2015-08-151-1/+1
| | | | ; * src/emacs,c, lib-src/ntlib.c: Comment updates.
* Remove files used by the old MS-Windows specific build procedureEli Zaretskii2015-08-151-482/+0
| | | | | | | | | | * nt/configure.bat: Remove everything except the blurb about the new build procedure. * make-dist: Remove references to makefile.w32-in in various directories, and to files in nt/ that were deleted. * etc/NEWS: Mention the fact that the files were dropped.
* Don't abort emacsclientw when -a was specifiedEvgeny Fraimovitch2015-08-021-0/+10
| | | | | | | * 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
* Get ‘./configure; make -C src emacs’ to workPaul Eggert2015-06-241-1/+1
| | | | | | Without this fix, lib/fcntl.h isn't built in time (Bug#20894). * lib-src/Makefile.in (../lib/libgnu.a): * src/Makefile.in ($(lib)/libgnu.a): Build all, not libgnu.a.
* Make TAGS files more portable to MS-WindowsPaul Eggert2015-05-251-9/+0
| | | | | | | | * etc/NEWS: Document this. * lib-src/etags.c (readline_internal) [DOS_NT]: Don't treat CRs differently from GNUish hosts. * lisp/progmodes/etags.el (etags-goto-tag-location): Adjust STARTPOS to account for the skipped CRs in dos-style files.
* Fix a typo in last commitEli Zaretskii2015-05-251-1/+1
| | | | | | | | | | | * lib-src/etags.c (C_entries): Fix a typo. * test/etags/ETAGS.good_1: * test/etags/ETAGS.good_2: * test/etags/ETAGS.good_3: * test/etags/ETAGS.good_4: * test/etags/ETAGS.good_5: * test/etags/CTAGS.good: Update due to the change in etags.c.
* Fix tagging of class members in C-like OO languagesEli Zaretskii2015-05-251-19/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | * lib-src/etags.c (longopts): Add new option --class-qualify and its shorthand -Q. (print_help): Add help text for --class-qualify. (main): Add handling of -Q. (consider_token, C_entries) <omethodparm>: Append argument types to Objective C methods only if --class-qualify was specified. Qualify C++, Objective C, and Java class members with their class names only if --class-qualify was specified. (C_entries): If --class-qualify was not specified, remove the namespace and class qualifiers from tag names of C++ methods. This allows to use etags.el as xref back-end without the tag-symbol-match-p method, which greatly increases the number of potentially false positives. (Bug#20629) * doc/man/etags.1: Update to document the new --class-qualify option. * test/etags/ETAGS.good_1: * test/etags/ETAGS.good_2: * test/etags/ETAGS.good_3: * test/etags/ETAGS.good_4: * test/etags/ETAGS.good_5: * test/etags/CTAGS.good: Update due to changes in etags.c.
* Fix last change in etags.c that broke tagging compresed filesEli Zaretskii2015-05-251-0/+5
| | | | | * lib-src/etags.c (process_file_name) [MSDOS || DOS_NT]: Fix quoting of decompression shell command for MS-Windows/MS-DOS.
* Simpilify etags TEX mode scanningPaul Eggert2015-05-241-45/+29
| | | | | | | | * lib-src/etags.c (TEX_mode, TEX_esc, TEX_opgrp, TEX_clgrp): Remove static vars. (TeX_commands): Deduce escapes here instead. (TEX_LESC, TEX_SESC, TEX_mode): Remove; all uses removed. This removes the need for a reset_input call.
* Improve etags I/O error reportingPaul Eggert2015-05-241-80/+103
| | | | | | | | | | | | | | | | | | | * lib-src/etags.c: Don't include sys/types.h and sys/stat.h; no longer needed. (infilename): New static var. (process_file_name): Don't call 'stat'. Instead, just open the file for reading and report any errors. Don't bother making a copy of the file argument; it's not needed. Be more careful to use the failing errno when reporting an error. Quote the real name better (though no perfectly) when passing it to the shell. (reset_input): New function, which reports I/O errors. All uses of 'rewind' changed to use this function. (perhaps_more_input): New function, which also checks for I/O errors. All uses of 'feof' changed to use this function. (analyze_regex): Report an error if fclose fails. (readline_internal): Report an error if getc fails. (etags_mktmp): Return an error if close fails.
* etags.c: avoid side effects in 'if'Paul Eggert2015-05-241-9/+10
| | | | | * lib-src/etags.c (process_file_name, Perl_functions) (TEX_decode_env): Hoist side effects into previous statement.
* Fix last change in etags.c, which failed the test suiteEli Zaretskii2015-05-241-0/+1
| | | | | * lib-src/etags.c (intoken): Add '$' to the set, as it was there before the last change.
* Cleanup etags.c to use locale-independent codePaul Eggert2015-05-231-105/+109
| | | | | | | | | | | | | | | | | Although this doesn't alter behavior (as etags doesn't use setlocale), the new version is more clearly locale-independent and the executable is a bit smaller on my platform. * lib-src/etags.c: Include <limits.h>, for UCHAR_MAX. Include <c-ctype.h> instead of <ctype.h>. (CHARS, CHAR, init, _wht, _nin, _itk, _btk, _etk, white, nonam, endtk) (begtk, midtk): Remove; no longer needed. (iswhite, ISALNUM, ISALPHA, ISDIGIT, ISLOWER, lowcase): Remove. All callers changed to use c_isspace, c_isalnum, c_isalpha, c_isdigit, c_islower, c_tolower, respectively. (notinname, begtoken, intoken, endtoken): Rewrite as functions instead of macros, and initialize the tables at compile-time rather than at run-time.