1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-22 07:09:54 +00:00
Commit Graph

2799 Commits

Author SHA1 Message Date
Po Lu
825afc84d0 ; * lib-src/etags.c (do_move_file): Fix coding style. 2022-12-17 09:49:08 +08:00
Philipp Stephani
940d9070e9 Support newer glib versions (Bug#59061)
* lib-src/seccomp-filter.c (main): Allow pidfd_open system call
2022-12-09 19:32:14 +01:00
Stefan Kangas
40af27859e ; * lib-src/etags.c (escape_shell_arg_string): Minor doc fix. 2022-12-06 18:05:08 +01:00
Mattias Engdegård
43b7e7efbf Fix etags builds on non-Windows non-MS-DOS machines
* lib-src/etags.c: In this file, MSDOS is always defined but can be
either `true` or `false`, so don't used `defined MSDOS` as a condition.
2022-12-06 17:37:22 +01:00
Eli Zaretskii
7e6d1d1c47 ; Fix last change in etags.c. 2022-12-06 18:13:41 +02:00
lu4nx
01a4035c86 Fix etags local command injection vulnerability
* lib-src/etags.c: (escape_shell_arg_string): New function.
(process_file_name): Use it to quote file names passed to the
shell.  (Bug#59817)
2022-12-06 18:07:45 +02:00
Stefan Kangas
70ecdebc92 ; Fix typos (don't abbreviate "with" or "without") 2022-12-01 16:36:09 +01:00
Po Lu
afc7ed987b Allow be-resources to fail
* lib-src/be_resources.cc (be_perror): Print additional blurb.
(main): Return 0 on failure as well, but print the blurb.
Problem reported by the Haiku packager.
2022-11-29 06:26:16 +00:00
Gregory Heytings
5f97a085be Fix incompatible -t and -r options in emacsclient
* lib-src/emacsclient.c (decode_options): Do not allow -t and -r
together.
2022-11-28 00:16:00 +01:00
Eli Zaretskii
6f0906be51 ; Fix last change in etags.c
* lib-src/etags.c (cleanup_tags_file): Renamed from
clean_matched_file_tag.

* test/manual/etags/CTAGS.good_update:
* test/manual/etags/CTAGS.good_crlf: Update to match the test.
2022-11-27 15:43:39 +02:00
lu4nx
d48bb4874b Fixed ctags local command execute vulnerability
* lib-src/etags.c:

(clean_matched_file_tag): New function
(do_move_file): New function
(readline_internal):
Add `leave_cr` parameter, if true, include the \r character

* test/manual/etags/CTAGS.good_crlf: New file
* test/manual/etags/CTAGS.good_update: New file
* test/manual/etags/crlf: New file
* test/manual/etags/Makefile: Add `ctags -u` test cases
2022-11-27 15:20:49 +02:00
Shohei YOSHIDA
bacba02e5c * lib-src/emacsclient.c (print_help_and_exit): Fix --timeout. 2022-11-27 15:17:40 +02:00
lu4nx
6e82403013 ; Clean up unused function: cuserid
* lib-src/ntlib.c (cuserid): Remove unused function.
2022-11-26 16:28:45 +02:00
lu4nx
325515f979 Support Racket programs in 'etags'
* lib-src/ctags.c (Scheme_suffixes): Add the Racket language
extension ".rkt".

Copyright-paperwork-exempt: yes
2022-11-23 20:31:18 +02:00
Stefan Kangas
5e8c62ffca ; Fix typos 2022-11-23 05:49:22 +01:00
Stefan Kangas
40539c7587 ; Fix typos 2022-11-22 02:24:20 +01:00
Eli Zaretskii
1682bd18f5 Fix encoding and display of messages sent by server to emacsclient
* lisp/server.el (server-start): Use 'locale-coding-system' to
encode messages sent back to the client.

* lib-src/emacsclient.c (main): Print '-error' messages via
'message', not directly via 'fprintf'.  This shows the error on
MS-Windows when the client is invoked as 'emacsclientw', since
stderr goes to the bit bucket in that case.
2022-11-19 21:34:07 +02:00
Jan Stranik
8a6c5be683 Support multi-line C++11 strings in Ebrowse
* lib-src/ebrowse.c (yylex): Support C++11 multi-line strings.
(bug#58847)
2022-11-17 12:07:45 +02:00
Stefan Kangas
5247a72aec * lib-src/rcs2log: Add fallback for $TMPDIR. 2022-10-19 08:02:36 +02:00
Philipp Stephani
92703e00dc Add gettid to seccomp-filter
* lib-src/seccomp-filter.c (main): gettid is necessary on RHEL 9.0
(bug#56359).
2022-10-11 02:52:51 +02:00
Paul Eggert
345de32a5d Port bwrap/allows-stdout test to Ubuntu 22.04.1
Without this patch, Ubuntu 22.04.1 x86-64 "make check" reports a
failure in test/src/emacs-tests.el’s
emacs-tests/bwrap/allows-stdout.  One can reproduce the bug
without using the Emacs executable, by running this script:

  #!/bin/bash
  export LC_ALL=C
  exec strace -f -o /tmp/tr bwrap --ro-bind / / --seccomp 20 -- \
    cat /dev/null 20< lib-src/seccomp-filter-exec.bpf

This script exits with status 159, because "cat" didn’t get
started (it got a SIGSYS signal early on).

The command "journalctl -g SECCOMP" indicated that rseq (syscall
334) was the problem.  This syscall is issued by
/lib64/ld-linux-x86-64.so.2 before ‘main’ is called.

There’s another problem with the clone3 syscall, which is used by
pthread_create starting in glibc 2.34.  pthread_create is called
by g_child_watch_source_new, which is called by
init_process_emacs.

* lib-src/seccomp-filter.c (main): Allow rseq, clone3.  This
causes the test to pass.  Perhaps a fancier, more accurate patch
could be written by someone who has the time.
2022-10-10 12:36:38 -07:00
Paul Eggert
190582adf4 Don’t truncate seccomp-filter diagnostic
* lib-src/seccomp-filter.c (fail): Do not truncate diagnostic
arbitrarily to 1000 bytes when ERROR is nonzero.
2022-10-02 13:47:56 -07:00
Paul Eggert
5598886adc Prefer static_assert to verify in seccomp-filter
Prefer static_assert in just one file for now; the idea is to do
it elsewhere eventually.  static_assert is standard (starting with
C23) whereas verify is not, and static_assert can be used even in
pre-C23 files due to Gnulib’s support for it.
* lib-src/seccomp-filter.c: Do not include verify.h.
Prefer static_assert to verify.
2022-10-02 13:47:56 -07:00
Gregory Heytings
d096819089 Remove hard-coded path to pwd in Makefiles.
* Makefile.in:
* lib-src/Makefile.in:
* nextstep/Makefile.in:
* nt/Makefile.in: Replace hard-coded calls to /bin/pwd by calls
to 'pwd -P'.  Fixes bug#58080.
2022-09-28 16:30:47 +02:00
Paul Eggert
f6fb2b9e1f Port better to C23 bool+true+false keywords
C23 is adding the C++ keywords bool, true, and false;
prefer them to <stdbool.h> if they are available.
* admin/merge-gnulib (GNULIB_MODULES):
Add stdbool, which emulates C23 on pre-C23 platforms.
(AVOIDED_MODULES): Remove stdbool; Gnulib has renamed
this module to stdbool-c99 and nobody uses it so it does
not need to be avoided.
* m4/c-bool.m4: New file, from Gnulib stdbool module.
* lib-src/seccomp-filter.c, src/conf_post.h, src/dynlib.h:
* src/emacs-module.c, src/nsterm.m, src/systhread.h:
* test/src/emacs-module-resources/mod-test.c:
Use the C23 style and use bool without including <stdbool.h>.
The Gnulib stdbool module causes config.h to include stdbool.h
on pre-C23 platforms.
* src/emacs-module.h.in:
Don’t include <stdbool.h> if C23 or later, or if
it has already been included.
2022-09-28 01:09:01 -07:00
Po Lu
a1f1072975 Fix several printfs for 32 bit systems
* lib-src/emacsclient.c (main): Use right length modifier when
printing uintmax_t.
* src/alloc.c (check_pure_size): Use right length modifier when
printing ptrdiff_t.
2022-09-10 09:35:49 +08:00
Stefan Kangas
c6d8db8d91 Display error in emacsclient if setsockopt failed
* lib-src/emacsclient.c (set_tcp_socket, set_socket_timeout): Display
an error message if setsockopt failed.
2022-09-09 11:20:33 +02:00
Stefan Kangas
901d3a2b5d ; Make emacsclient.c more quiet again
* lib-src/emacsclient.c (main): Remove status message after getting a
response from the server.  (Bug#57650)
2022-09-07 23:38:55 +02:00
Stefan Kangas
ca0a8b554a ; * lib-src/emacsclient.c (main): Fix previous change. 2022-09-07 03:00:14 +02:00
Eli Zaretskii
088b81031b Fix the MS-Windows build
* lib-src/emacsclient.c (DEFAULT_TIMEOUT): Move out of the
!WINDOWSNT condition, to fix the MS-Windows compilation.
(set_socket_timeout) [WINDOWSNT]: Protect against too-large values
of timeout.
2022-09-06 15:09:09 +03:00
Stefan Kangas
6a19f2a024 Add new --timeout flag to emacsclient
* lib-src/emacsclient.c (DEFAULT_TIMEOUT): New constant.
(timeout): New static variable.
(longopts, shortopts, decode_options, print_help_and_exit): Add new
flag --timeout.
(set_socket_timeout, check_socket_timeout): New helper functions.
(main): Display a status message or exit after Emacs has not responded
for a while, depending on above new --timeout flag.  (Bug#50849)

* doc/emacs/misc.texi (emacsclient Options):
* doc/man/emacsclient.1: Document the above new option.
* etc/NEWS: Announce it.
2022-09-06 02:05:18 +02:00
Stefan Kangas
cf98a395d0 * lib-src/etags.c: Remove XEmacs support. 2022-08-07 14:50:05 +02:00
Stefan Monnier
9e9b0e13bc Revert "Revert part of 59732a83c8 to fix bug#52969"
This reverts commit 460f35e96d.

Re-remove the code that scans .el files for docstrings, now
that even `lisp/loaddefs.el` is compiled.

* lib-src/make-docfile.c (scan_file): Don't call `scan_lisp_file`.
(scan_lisp_file, skip_white, read_lisp_symbol, search_lisp_doc_at_eol):
Delete functions.
2022-08-03 17:02:25 -04:00
Stefan Kangas
9699eaf8af Merge from origin/emacs-28
db259d8fd3 Build Seccomp filter only if we have a 64-bit userspace (B...
2022-07-16 06:30:39 +02:00
Philipp Stephani
db259d8fd3 Build Seccomp filter only if we have a 64-bit userspace (Bug#56549)
* configure.ac (SIZEOF_LONG): New variable.
* lib-src/Makefile.in (SIZEOF_LONG): New variable; added conditional.
2022-07-15 17:56:02 +02:00
Eli Zaretskii
8a098f6517 Fix quoting of file names in 'ctags'
* lib-src/etags.c (main) [WINDOWSNT || MSDOS]: Quote file names
according to the rules of the system shells.
2022-07-01 16:17:40 +03:00
Eli Zaretskii
8ef3862fa0 Update the 'etags' test suite
* ETAGS.good_1:
* ETAGS_good_2:
* ETAGS_good_3:
* ETAGS_good_4:
* ETAGS_good_5:
* ETAGS_good_6: Adapt to recent changes in test sources.

* lib-src/etags.c (C_entries): Add commentary for resetting
bracelev.  (Bug#45246)
2022-06-09 20:33:43 +03:00
Paul Eggert
a1c19dfca4 Pacify GCC 12 -Wanalyzer-use-of-uninitialized-value
* lib-src/etags.c (readline_internal): Do not copy a pointer to
freed storage, as that has undefined behavior even if the pointer
is not dereferenced.
(relative_filename): Avoid a backward scan by remembering where
the last slash was.  This is a bit faster, and pacifies a GCC
false alarm.
2022-05-31 01:26:47 -07:00
Lars Ingebrigtsen
59951f7af5 Audit quoting symbols in C doc strings
* test/manual/etags/c-src/emacs/src/keyboard.c (Frecursive_edit):
* src/xfns.c (syms_of_xfns):
* src/xdisp.c (Fwindow_text_pixel_size):
(syms_of_xdisp):
* src/w32notify.c (Fw32notify_add_watch):
(Fw32notify_add_watch):
* src/frame.c (Fframe_child_frame_border_width):
* src/comp.c (Fcomp__subr_signature):
* src/alloc.c (Fgarbage_collect):
* lib-src/make-docfile.c (scan_c_stream): Audit quoting symbols in C
doc strings.
2022-05-24 11:51:18 +02:00
Paul Eggert
0f731c49e6 Pacify GCC 12 in default developer build
This lets ‘./configure; make’ work on Fedora 36 x86-64 from a Git
checkout without generating false-alarm warnings.
* lib-src/etags.c (main): There appeared to be false alarm with
GCC 12.  However, the code was wrong anyway, as it mishandled file
names containing "'" so fix that bug.  This pacifies GCC.
(mercury_decl): Omit tests ‘s + pos != NULL’ that were apparently
intended to be ‘s[pos] != '\0'’ but which were miscoded to always
be true and which were mostly not needed anyway.  In one place,
though, a test was needed, so fix that by using strchr instead.
* src/alloc.c (lisp_free) [!GC_MALLOC_CHECK]:
* src/term.c (Fsuspend_tty): Don’t look at a pointer after freeing
it, even just to test it for equality with some other pointer, as
this has undefined behavior in C and GCC 12 diagnoses this.
* src/dbusbind.c (xd_read_message_1): Rework the code a bit
so that it has fewer tests.  This pacifies GCC 12 which was
complaining incorrectly about dereferencing a null pointer.
* src/intervals.c (copy_properties): Remove an eassume that should
no longer be needed even to pacify older GCCs, due to ...
* src/intervals.h (split_interval_left): ... this addition of
ATTRIBUTE_RETURNS_NONNULL to pacify a GCC 12 warning about
dereferencing a null pointer.
* src/regex-emacs.c (EXTEND_BUFFER): Use negative values rather
than auxiliary booleans to indicate null pointers.  This pacifies
GCC 12 false alarms about using uninitialized variables.
* src/xdisp.c (clear_position): New function.
(append_space_for_newline, extend_face_to_end_of_line):
Use it to work around false alarms from GCC 12.
(display_and_set_cursor): Add an UNINIT to pacify GCC 12.
* src/xterm.c (x_draw_glyphless_glyph_string_foreground):
Defend against hypothetical bad code elsewhere;
this also pacifies GCC 12.
(x_term_init): Use fixed-size auto array rather than alloca,
as the array is small; this also pacifies GCC 12.
2022-05-12 17:03:55 -07:00
Paul Eggert
6662079b90 Merge from origin/emacs-28
3cccf0a910 Don’t assume openat
2022-04-17 13:10:19 -07:00
Eli Zaretskii
c2f94f32b5 Revert "Don’t assume openat"
This reverts commit 3cccf0a910.

This is a change with far-reaching effects on MS-Windows at the least,
where file-related APIs are shadowed to support transparent support
for UTF-8 encoded file names.  Making such changes on a stable branch
for the benefit of a proprietary platform with a 13-year old OS is a
tail wagging the dog.  Please don't do that without discussing first.
2022-04-17 22:03:52 +03:00
Paul Eggert
3cccf0a910 Don’t assume openat
Use openat only on platforms with O_PATH.
This ports to OS X 10.9 and earlier.
Problem reported by Keith David Bershatsky in:
https://lists.gnu.org/r/emacs-devel/2022-04/msg00805.html
* lib-src/emacsclient.c (local_sockname): Use open, not openat.
* src/sysdep.c (sys_openat): New static function,
which uses openat only if O_PATH is defined.
(emacs_openat): Use it instead of openat.
(emacs_openat_noquit): Remove.
(emacs_open_noquit): Reimplement as per the old emacs_openat_noquit,
but use plain 'open'.
2022-04-17 10:43:13 -07:00
Paul Eggert
d9bffa1f3b ebrowse dumping need not return int
* lib-src/ebrowse.c (dump_members, dump_tree): Return void, not
int, since callers never actually use returned value.  All uses
changed.
2022-04-08 17:33:15 -07:00
Paul Eggert
ec35e2621a Do not include <attribute.h> from <config.h>
This is because mod-test.c shouldn’t use source code from lib,
but it does need to include <config.h>.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/seccomp-filter.c, src/dynlib.h, src/lisp.h:
* src/syssignal.h, src/sysstdio.h, src/systhread.h, src/tparam.h:
Include <attribute.h>.
* src/conf_post.h: Do not include <attribute.h>.
All uses of attribute.h macros replaced with their _GL_ equivalents.
2022-03-08 18:51:17 -08:00
Stefan Kangas
200627c255 Merge from origin/emacs-28
0090318c61 * lib-src/seccomp-filter.c (main): Use faccessat2 only if ...
3bb01a499b Fix regression in derived-mode-init-mode-variables
2022-03-06 06:32:23 +01:00
Andreas Schwab
0090318c61 * lib-src/seccomp-filter.c (main): Use faccessat2 only if defined. 2022-03-05 14:41:22 +01:00
Stefan Kangas
1319d108da Merge from origin/emacs-28
6d3608be88 Seccomp: improve support for newer versions of glibc (Bug#...
e58ecd01d5 EUDC: Fix a quoting bug in the BBDB backend
2022-01-23 06:30:31 +01:00
Philipp Stephani
6d3608be88 Seccomp: improve support for newer versions of glibc (Bug#51073)
* lib-src/seccomp-filter.c (main): Allow 'pread64' and 'faccessat2'
system calls.  Newer versions of glibc use these system call (starting
with commits 95c1056962a3f2297c94ce47f0eaf0c5b6563231 and
3d3ab573a5f3071992cbc4f57d50d1d29d55bde2, respectively).
2022-01-22 17:18:50 +01:00
Po Lu
03f4a2ff64 Merge from origin/emacs-28
11ea45c9e4 Fix UB in ebrowse
ba57b78064 Fix execute-extended-command-for-buffer in fundamental-mode
ef0c1d4c2c Add workaround to handle a problem with Enlightenment WM (...
2022-01-21 15:27:35 +08:00
Eli Zaretskii
11ea45c9e4 Fix UB in ebrowse
* lib-src/ebrowse.c (matching_regexp): Avoid writing beyond the
limits of 'matching_regexp_buffer'.  Patch by Jan Stranik
<jan@stranik.org>.  (Bug#53333)

Copyright-paperwork-exempt: yes
2022-01-20 13:42:56 +02:00
Po Lu
412247c53f Fix Emacs icon not appearing on Haiku
* lib-src/be_resources.cc (main): Scale input bitmap
appropriately before setting it as the mini and large icons.
* src/Makefile.in (Emacs): Add dependency on
`lib-src/be-resources'.
2022-01-17 11:09:50 +00:00
Glenn Morris
745580a36d Avoid user environment interfering with bootstrap
* Makefile.in, admin/unidata/Makefile.in:
* doc/misc/Makefile.in, lib-src/Makefile.in:
Don't export user environment variables that can affect running
emacs.  (Bug#53038)
2022-01-12 09:35:43 -08:00
Stefan Kangas
24a52df738 Fix two unused variable warnings in make-docfile.c
* lib-src/make-docfile.c (scan_lisp_file): Fix unused variable
warnings.
2022-01-04 03:52:42 +01:00
Stefan Monnier
460f35e96d Revert part of 59732a83c8 to fix bug#52969
While we don't need to put docstrings of .elc files into etc/DOC,
we still need to put those of `loaddefs.el` there since we don't have
a "dynamic docstring" feature for the non-compiled files and keeping
the actual docstrings in the heap would be prohibitive.

* src/Makefile.in ($(etc)/DOC): Scan `lisp/loaddefs.el` still.

* lib-src/make-docfile.c (scan_lisp_file): New function.
(scan_file): Use it.
(skip_white, read_lisp_symbol, search_lisp_doc_at_eol): New functions.
2022-01-03 15:04:12 -05:00
Stefan Kangas
ad125a9927 Merge from origin/emacs-28
efb1c7ec37 ; * admin/notes/years: More known problems.
f475c5823a ; Copyright year fixes
2684def348 ; Run set-copyright from admin.el
2558b37b5e ; * admin/notes/years: Mention known problems with 'update...
2022-01-02 06:31:44 +01:00
Glenn Morris
2684def348 ; Run set-copyright from admin.el 2022-01-01 09:52:06 -08:00
Eli Zaretskii
823b6b8d26 ; Add 2022 to copyright years. 2022-01-01 07:07:15 -05:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	lib/cdefs.h
#	lisp/erc/erc-dcc.el
#	lisp/erc/erc-imenu.el
#	lisp/erc/erc-replace.el
#	lisp/image-dired.el
#	lisp/progmodes/xref.el
#	m4/alloca.m4
#	m4/byteswap.m4
#	m4/errno_h.m4
#	m4/getopt.m4
#	m4/gnulib-common.m4
#	m4/inttypes.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Stefan Monnier
59732a83c8 Don't store docstrings of preloaded .el files in etc/DOC
Since the location of those files changes between build time and
installation time, this requires to tweak the file name used in those
(#$ . NNN) references during the dump so they don't hardcode the build
directory.  We do it in the same way as was already done for those
same file names in `load-history`, except we convert them back to
absolute file names more lazily (i.e. when fetching the actual
docstring rather than at startup), which requires remembering the
`lisp-dir` computed at startup in the new `lisp-directory` variable.

* src/Makefile.in ($(etc)/DOC): Don't scan Lisp files any more.

* src/lread.c (Fload): Use relative file names for `load-file-name`
when preloading for the dump, like we already did for `current-load-list`.
(read_list): Don't zero-out dynamic docstring references during the
preload since they won't be filled later by Snarf-documentation any more.
(read1): Remove the hash-hack for doc references that were zeroed.

* lisp/startup.el (lisp-directory): New variable.
(command-line): Set it.

* src/doc.c (get_doc_string): Use `lisp-directory` for dynamic
docstring references using relative file names.
(syms_of_doc): Add `Qlisp_directory`.

* lib-src/make-docfile.c (scan_file): Don't handle `.el` or `.elc`
files any more.
(IS_SLASH): Remove macro, not used any more.
(skip_white, read_lisp_symbol, search_lisp_doc_at_eol)
(scan_lisp_file): Remove functions, not used any more.

* doc/lispref/loading.texi (Library Search): Mention `lisp-directory`.
2021-12-30 23:17:45 -05:00
Paul Eggert
eaa44ca40e Prefer $(info) to @echo
Have GNU Make output some diagnostics directly, instead of forking
and execing a shell to do it.
* GNUmakefile (help):
* doc/lispref/two-volume.make (vol2.pdf, elisp2med-init)
(elisp2-init):
* doc/misc/Makefile.in (echo-info, echo-sources):
* lib-src/Makefile.in (archlibdir, install, check):
* src/verbose.mk.in (AM_V_AR, AM_V_CC, AM_V_CXX, AM_V_CCLD)
(AM_V_CXXLD, AM_V_ELC, AM_V_ELN, AM_V_GEN, AM_V_GLOBALS)
(AM_V_RC):
* test/Makefile.in (subdirs, subdir-targets):
Prefer $(info) to @echo.
* GNUmakefile (MAKECMDGOALS, configure, Makefile):
Prefer $(warning) to @echo >&2.
* src/verbose.mk.in (AM_V_ELN): Output target, like the others.
2021-12-20 12:24:04 -08:00
Po Lu
2de147e93c Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-12-12 21:40:17 +08:00
Lars Ingebrigtsen
194556425f Really fix the etags TEX parsing
* lib-src/etags.c (TEX_decode_env): Re-fix off-by-one parsing of
TEXTAGS environment variable (bug#52438).
2021-12-12 11:45:11 +01:00
Lars Ingebrigtsen
bdfd83e42d Fix an off-by-one error in TEX parsing in etags
* lib-src/etags.c (TEX_decode_env): Fix off-by-one parsing of
TEXTAGS environment variable (bug#52438).  Based on a patch by
David Fussner <dfussner@googlemail.com> and amended by Andreas
Schwab <schwab@linux-m68k.org>.
2021-12-12 11:26:22 +01:00
Po Lu
cc0f147180 Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-12-10 14:50:21 +08:00
Stefan Kangas
d601fd4692 Merge from origin/emacs-28
7a25ba0fde ; * lisp/image-dired.el: Fix typo.
dda6337066 emacsclient takes more care about XDG_RUNTIME_DIR
26fb4168b8 ; Prefer HTTPS in more URLs
6b89578524 ; * lisp/progmodes/flymake.el: Update the minimum Emacs ve...
2021-12-10 06:30:33 +01:00
Paul Eggert
dda6337066 emacsclient takes more care about XDG_RUNTIME_DIR
* lib-src/emacsclient.c (set_local_socket): Revert to the Emacs 27
behavior of not trying TMPDIR if XDG_RUNTIME_DIR is set.
This is one of the suggestions made by Jim Porter and
independently by Ulrich Mueller in Bug#51327.
2021-12-09 12:03:37 -08:00
Po Lu
57a9bf8d41 Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-12-03 14:07:40 +08:00
Stefan Kangas
c66eb52453 Merge from origin/emacs-28
9c222b9c1a Port to C compilers that lack size-0 arrays
fed35a8951 Port emacsclient to Solaris 10
f35d6a9c73 * CONTRIBUTE: Improve commit message instructions
e0ee1d003a Work around IBM XL C compiler bug
6b99b6eb8b * admin/make-tarball.txt: Various clarifications.
bbf4140091 * admin/diff-tar-files: Don't assume .tar.gz.
0a50ad11db * lisp/tab-bar.el (tab-bar-close-other-tabs): Fix regression.
2021-12-03 06:30:26 +01:00
Paul Eggert
fed35a8951 Port emacsclient to Solaris 10
Without this patch, the build fails on Solaris 10 with the diagnostic
“Undefined symbol acl_trivial first referenced in file
../lib/libgnu.a(file-has-acl.o)”.
* lib-src/Makefile.in (LIB_HAS_ACL): New macro.
(emacsclient${EXEEXT}): Link with $(LIB_HAS_ACL).
2021-12-02 18:45:05 -08:00
Po Lu
5477b929da Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-12-01 15:20:08 +08:00
Jim Porter
3e756b12b6 Suppress emacsclient message that daemon should have started if --quiet
* lib-src/emacsclient.c (start_daemon_and_retry_set_socket): Don't
output "daemon should have started" message if --quiet (bug#52214).
2021-12-01 05:56:55 +01:00
Po Lu
8f5d2a3181 Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-11-30 08:16:50 +08:00
Po Lu
85a078e785 Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.

* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.

* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.

* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.

* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.

* doc/emacs/haiku.texi: New Haiku appendix.

* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.

* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.

* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.

* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.

* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.

* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.

* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.

* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.

* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.

* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.

(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.

(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.

* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.

* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.

* lisp/menu-bar.el (menu-bar-open): Add for Haiku.

* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.

* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.

* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.

* lisp/term/haiku-win.el: New file.

* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.

* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.

* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.

(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.

(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.

* src/alloc.c (garbage_collect): Mark Haiku display.

* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.

* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.

* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.

* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.

* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.

* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.

* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.

* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.

* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.

* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.

* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.

* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.

* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.

* src/haiku.c: Add new files for Haiku operating system
support.

* src/image.c: Implement image transforms and native XPM
support
on Haiku.

(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.

(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.

* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.

* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.

* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.

* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.

* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.

* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.

* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.

* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.

* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.

* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.

* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.

* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 21:46:07 +08:00
Yuuki Harano
4dd1f56f29 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs into feature/pgtk 2021-11-11 00:39:53 +09:00
Gregory Heytings
2bcc2160c9 New emacsclient option to either create or reuse an existing frame.
* doc/emacs/misc.texi (emacsclient Options): Document the new option.

* doc/man/emacsclient.1: Mention the new option (bug#51374).
* etc/NEWS: Mention the new option.

* lib-src/emacsclient.c (reuse_frame): New variable.
(longopts): New option.
(decode_options): Decode the new option.
(print_help_and_exit): Document the new option.
(main): Use the new option.
2021-11-05 00:14:30 +01:00
Eli Zaretskii
3bad61e1ac Fix compilation errors with MinGW64 GCC 11
* lib-src/ntlib.c (IS_DIRECTORY_SEP): Remove redundant macro.

* lib-src/ntlib.c (DEFER_MS_W32_H):
* nt/addpm.c (DEFER_MS_W32_H):
* nt/cmdproxy.c (DEFER_MS_W32_H):
* nt/ddeclient.c (DEFER_MS_W32_H):
* nt/preprep.c (DEFER_MS_W32_H):
* nt/runemacs.c (DEFER_MS_W32_H): Fix a typo.
* nt/Makefile.in (BASE_CFLAGS): Add -I switches to pick up
config.h and lib/attribute.h.
2021-10-24 20:45:56 +03:00
Paul Eggert
beb265450c Include <config.h> first in MS-Windows source 2021-10-24 20:22:17 +03:00
Eli Zaretskii
3f763898aa Fix compilation errors with MinGW64 GCC 11
* lib-src/ntlib.c (_GL_ATTRIBUTE_MALLOC)
(_GL_ATTRIBUTE_DEALLOC_FREE): Define to avoid compilation errors
with MinGW64 GCC 11.  Suggested by Andy Moreton
<andrewjmoreton@gmail.com>.  Do not merge to master.
2021-10-24 20:19:47 +03:00
Philipp Stephani
b497add971 Fix Seccomp filter for newer GNU/Linux systems (Bug#51073).
On some systems, process startup calls prctl(PR_CAPBSET_READ) via
'cap_get_bound'.  We can just return EINVAL.

* lib-src/seccomp-filter.c (main): Add a rule for
prctl(PR_CAPBSET_READ, ...).
2021-10-09 19:39:31 +02:00
Paul Eggert
732c70a0d9 Simplify socket symlink-attack checking
This is a minor bugfix cleanup (Bug#33847#161).
* lib-src/emacsclient.c: Move "#include <acl.h>" to inside
"#ifdef SOCKETS_IN_FILE_SYSTEM", which is more accurate
and simpler than having a separate "#ifndef WINDOWSNT".
(O_PATH): Likewise.
2021-10-03 11:42:20 -07:00
Stefan Kangas
0cabf8bc36 ; Fix typos 2021-09-03 13:05:32 +02:00
Philipp Stephani
8fa624b39b Improve compatibility with musl-libc (Bug#48789)
* lib-src/seccomp-filter.c (export_filter): Remove use of
nonstandard macro TEMP_FAILURE_RETRY.
2021-08-29 20:51:39 +02:00
Alan Third
3065b6b73b Fix libexec installation on NS (bug#50250)
* lib-src/Makefile.in (ns_applibexecdir): New variable.
2021-08-29 13:09:21 +01:00
Omar Polo
5b55659bae Avoid using %n in emacsclient
* lib-src/emacsclient.c (local_sockname): Avoid using %n (bug#50155).
2021-08-22 16:23:54 +02:00
Yuuki Harano
13a9a5e836 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-07-25 23:34:55 +09:00
Paul Eggert
007744dd04 Redo emacsclient socket symlink-attack checking
* admin/merge-gnulib (GNULIB_MODULES): Add file-has-acl.
* lib/file-has-acl.c: New file, copied from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib-src/emacsclient.c: Include acl.h, for file_has_acl.
(O_PATH): Default to O_SEARCH, which is good enough here.
(union local_sockaddr): New type.
(socket_status): Remove, replacing with ...
(connect_socket): New function.  All callers changed.
This function checks for ownership and permissions issues with the
parent directory of the socket file, instead of checking the
owner of the socket (which does not help security).
(socknamesize): Move to file scope.
(local_sockname): New arg S.  No need to pass socknamesize.
UID arg is now uid_t.  All callers changed.  Get file descriptor
of parent directory of socket, to foil some symlink attacks.
Do not follow symlinks to that directory.
(set_local_socket): Create the socket here instead of on
each attempt to connect it.  Fall back from XDG_RUNTIME_DIR
to /tmp only if the former fails due to ENOENT.  Adjust
permission-failure diagnostic to match changed behavior.

This addresses Bug#33847, which complained about emacsclient in a
safer XDG environment not connecting to an Emacs server running in
a less-safe enviroment outside XDG.  The patch fixes a
longstanding issue with emacsclient permission checking.
It’s ineffective to look at the permission of the socket file
itself; on some platforms, these permissions are ignored anyway.
What matters are the permissions on the parent directory of the
socket file, as these are what make symlink attacks possible.
Change the permissions check accordingly, and also refuse to
follow symlinks to that parent directory.  These changes make it
OK for emacsclient to fall back from XDG_RUNTIME_DIR to the
traditionally less-safe /tmp/emacsNNNN directories, since /tmp is
universally sticky nowadays.
2021-07-23 13:33:37 +02:00
Yuuki Harano
b242394f24 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-07-18 18:44:54 +09:00
Paul Eggert
2337869fbf Pacify gcc 11.1.1 -Wanalyzer-null-argument
* lib-src/etags.c (regexp): Omit member force_explicit_name,
since it’s always true.  All uses removed.  This lets us
remove calls to strlen (name) where GCC isn’t smart enough
to deduce that name must be nonnull.
* lib-src/movemail.c (main): Fix bug that could cause
link (tempname, NULL) to be called.
* src/emacs.c (argmatch): Break check into two ‘if’s,
since GCC doesn’t seem to be smart enough to check the single ‘if’.
* src/gtkutil.c (xg_update_menu_item): Fix bug where strcmp
could be given a NULL arg.
* src/xfont.c (xfont_list_family): Use nonnull value for dummy
initial value.
2021-07-12 00:12:20 -07:00
Yuuki Harano
01b0a909b5 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-06-20 18:17:23 +09:00
Eli Zaretskii
6af9f1f3ef Improve and update the 'etags' test suite
* lib-src/etags.c (mercury_pr): Remove redundant comment.

* test/manual/etags/merc-src/accumulator.m: Add more complex
declarations.
* test/manual/etags/ETAGS.good_1:
* test/manual/etags/ETAGS.good_2:
* test/manual/etags/ETAGS.good_3:
* test/manual/etags/ETAGS.good_4:
* test/manual/etags/ETAGS.good_5:
* test/manual/etags/ETAGS.good_6:
* test/manual/etags/CTAGS.good: Adapt to latest changes in 'etags'
and the test suite.  (Bug#47408)
2021-06-18 14:28:16 +03:00
Fabrice Nicol
0ffcf7479c Fix Mercury support, notably qualified procedures.
Correct the previous fix (did not correctly handle qualified types).
    Also fix the following issues:
    - remove module name (+ dot) from tags, as prefixing module name is
      often inconsistent in code and may cause tags to be too specific.
    - now tag 0-arity predicates and functions (':- func foo_14.')
    - now tag one-word declarations (':- interface.')

    * lib-src/etags.c (mercury_pr): Pass the correct NAME and NAMELEN
    arguments to 'make_tag'.
    (mercury_decl): Return more information about the declaration or
    definition it finds.  This allows mercury_pr to be smarter.
    (Bug#47408)
2021-06-18 14:18:34 +03:00
Yuuki Harano
7d5e94bada Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-06-13 17:34:06 +09:00
Eli Zaretskii
af4cccb8d9 Support mercury in 'ctags' as well
The previous lack of support was due to incorrect calls to 'make_tag'
in 'mercury_pr', which caused 'pfnote' to refrain from adding Mercury
tags to the list of recorded tags.

* lib-src/etags.c (mercury_pr): Pass the correct NAME and NAMELEN
arguments to 'make_tag'.

* test/manual/etags/CTAGS.good: Adjust to the above change.
2021-06-10 16:57:03 +03:00
Eli Zaretskii
6ef5760b10 Minor fixes for last change
* test/manual/etags/ETAGS.good_1:
* test/manual/etags/ETAGS.good_2:
* test/manual/etags/ETAGS.good_3:
* test/manual/etags/ETAGS.good_4:
* test/manual/etags/ETAGS.good_5:
* test/manual/etags/ETAGS.good_6: Adapt to added Mercury support.

* lib-src/etags.c (find_entries, test_objc_is_mercury):
* etc/NEWS: Fix punctuation and typos in last change.
2021-06-06 12:44:49 +03:00
Fabrice Nicol
5a8a5a990a Add support for Mercury (https://mercurylang.org) in 'etags'
Tag declarations starting lines with ':-'.
By default, all declarations are tagged.  Optionally, first
predicate or functions in clauses can be tagged as in Prolog
support using '--declarations'.  (Bug#47408).
* lib-src/etags.c (test_objc_is_mercury, Mercury_functions)
(mercury_skip_comment,  mercury_decl, mercury_pr):
Implement Mercury support.  As Mercury and Objective-C have
the same file extension .m, a heuristic test tries to detect
the language.

* doc/man/etags.1: Document the change.  Add Mercury-specific
 behavior for '--declarations'.  This option tags first
predicates or functions in clauses in addition to declarations.
2021-06-06 12:29:29 +03:00
Yuuki Harano
e48372f8e5 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-05-19 22:02:06 +09:00
Pierre-Antoine Rouby
ec870f8986 Add support for Rust in etags
* lib-src/etags.c (Rust_functions): New function to make tags for rust
files.
(Rust_help, Rust_suffixes): New constant.
* doc/emacs/maintaining.texi (Tag Syntax): Add Rust item.
* doc/man/etags.1: Add Rust (bug#46055).
2021-05-17 17:24:04 +02:00
Glenn Morris
aa354dd55b * lib-src/Makefile.in (clean): Tidy up seccomp-filter files. 2021-05-09 18:46:11 -07:00