Skip to content

Commit a722c86

Browse files
author
Yuuki Harano
committed
Merge branch 'master' of https://github.com/emacs-mirror/emacs into pgtk
2 parents 5e194ee + 688e924 commit a722c86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+666
-475
lines changed

INSTALL

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -214,41 +214,42 @@ like 'apt-get build-dep emacs' (on older systems, replace 'emacs' with
214214
eg 'emacs25'). On Red Hat-based systems, the corresponding command is
215215
'dnf builddep emacs' (on older systems, use 'yum-builddep' instead).
216216

217+
218+
DEBUGGING AN INSTALLED EMACS
219+
220+
* Installed Emacs source code
221+
222+
Emacs typically installs a compressed copy of much of its source code,
223+
to make it easy for users to read Emacs source code via commands like
224+
M-x describe-function (C-h f) to display the definition of a function.
225+
This compressed copy ordinarily includes both the Elisp source code
226+
that Emacs is mostly written in, as well as the C source code for the
227+
core Emacs executable.
228+
217229
* GNU/Linux source and debug packages
218230

219231
Many GNU/Linux systems provide separate packages containing the
220-
sources and debug symbols of Emacs. They are useful if you want to
221-
check the source code of Emacs primitive functions or debug Emacs on
222-
the C level.
223-
224-
The names of the packages that you need vary according to the
225-
GNU/Linux distribution that you use. On Debian-based systems, you can
226-
install a source package of Emacs with a command like 'apt-get source
227-
emacs' (on older systems, replace 'emacs' with eg 'emacs25'). The
228-
target directory for unpacking the source tree is the current
229-
directory. On Red Hat-based systems, the corresponding command is
230-
'dnf install emacs-debugsource', with target directory /usr/src/debug
231-
(this requires to add the *-debuginfo repositories first, via 'dnf
232-
config-manager --set-enabled fedora-debuginfo updates-debuginfo').
233-
234-
Once you have installed the source package, for example at
235-
/path/to/emacs-26.1, add the following line to your startup file:
236-
237-
(setq find-function-C-source-directory
238-
"/path/to/emacs-26.1/src")
239-
240-
The installation directory of the Emacs source package will contain
241-
the exact package name and version number Emacs is installed on your
242-
system. If a new Emacs package is installed, the source package must
243-
be reinstalled as well, and the setting in your startup file must be
244-
updated.
245-
246-
Emacs debugging symbols are distributed by a debug package. It does
247-
not exist for every released Emacs package, this depends on the
248-
distribution. On Debian-based systems, you can install a debug
249-
package of Emacs with a command like 'apt-get install emacs-dbg' (on
250-
older systems, replace 'emacs' with eg 'emacs25'). On Red Hat-based
251-
systems, the corresponding command is 'dnf debuginfo-install emacs'.
232+
sources and debug symbols of Emacs. They can help you debug the
233+
installed Emacs on the C level. The procedures for installing these
234+
packages depend on the GNU/Linux system that you use.
235+
236+
Emacs debugging symbols are distributed by a debug package if one
237+
exists for your system. On Debian-based systems, you can
238+
install a debug package of Emacs with a command like 'apt-get install
239+
emacs-dbg' (on older systems, replace 'emacs' with e.g. 'emacs25').
240+
On Red Hat-based systems, the corresponding command is 'dnf
241+
debuginfo-install emacs'; this may require adding the *-debuginfo
242+
repositories first, via 'dnf config-manager --set-enabled
243+
fedora-debuginfo updates-debuginfo'.
244+
245+
Some systems also have an Emacs source package that is also helpful
246+
when debugging the installed Emacs. To unpack an Emacs source package
247+
into the current directory on Debian-based systems, you can use a
248+
command like 'apt-get source emacs' (on older systems, replace 'emacs'
249+
with e.g. 'emacs25'); you may first need to add the appropriate
250+
'source' URIs to your sources.list. On Red Hat-based systems,
251+
installing the debugging symbols automatically installs the
252+
corresponding source package in the appropriate location.
252253

253254

254255
DETAILED BUILDING AND INSTALLATION:

Makefile.in

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,9 @@ etcdir=@etcdir@
269269
# once.
270270
archlibdir=@archlibdir@
271271

272+
# Where to install Emacs C source code, or empty if it is not installed.
273+
emacs_srcdir=@emacs_srcdir@
274+
272275
# Where to put the etc/DOC file.
273276
etcdocdir=@etcdocdir@
274277

@@ -381,6 +384,7 @@ epaths-force:
381384
-e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \
382385
-e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \
383386
-e 's;\(#.*PATH_GAME\).*$$;\1 $(PATH_GAME);' \
387+
-e 's;\(#.*PATH_EMACS_SOURCE\).*$$;\1 "${emacs_srcdir}";' \
384388
-e 's;\(#.*PATH_DOC\).*$$;\1 "${etcdocdir}";') && \
385389
${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h
386390

@@ -468,7 +472,7 @@ $(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/m4/*.m4
468472
# ==================== Installation ====================
469473

470474
.PHONY: install install-arch-dep install-arch-indep install-etcdoc install-info
471-
.PHONY: install-man install-etc install-strip install-$(NTDIR)
475+
.PHONY: install-man install-c-src install-etc install-strip install-$(NTDIR)
472476
.PHONY: uninstall uninstall-$(NTDIR)
473477

474478
## If we let lib-src do its own installation, that means we
@@ -575,7 +579,8 @@ set_installuser=for installuser in $${LOGNAME} $${USERNAME} $${USER} \
575579
## work correctly, and therefore no idea when tar can be replaced.
576580
## See also these comments from 2004 about cp -r working fine:
577581
## https://lists.gnu.org/r/autoconf-patches/2004-11/msg00005.html
578-
install-arch-indep: lisp install-info install-man ${INSTALL_ARCH_INDEP_EXTRA}
582+
install-arch-indep: lisp install-info install-man install-c-src \
583+
$(INSTALL_ARCH_INDEP_EXTRA)
579584
umask 022 && $(MKDIR_P) "$(DESTDIR)$(includedir)"
580585
$(INSTALL_DATA) src/emacs-module.h "$(DESTDIR)$(includedir)/emacs-module.h"
581586
-set ${COPYDESTS} ; \
@@ -707,6 +712,28 @@ install-man:
707712
${GZIP_PROG} -9n "$(DESTDIR)${man1dir}/$${dest}" || true; \
708713
done
709714

715+
install-c-src:
716+
ifneq (,$(emacs_srcdir))
717+
-unset CDPATH; \
718+
umask 022; $(MKDIR_P) "$(DESTDIR)$(emacs_srcdir)/src" && \
719+
exp_sourcesrcdir=`cd "$(DESTDIR)$(emacs_srcdir)/src" && /bin/pwd` && \
720+
[ "`cd $(srcdir)/src && /bin/pwd`" = "$$exp_sourcesrcdir" ] || { \
721+
$(set_installuser); \
722+
printf 'Copying compressed C sources to %s ...\n' \
723+
"$(DESTDIR)$(emacs_srcdir)/src"; \
724+
for file in `cd $(srcdir) && echo src/*.[cm]`; do \
725+
installed_file="$(DESTDIR)$(emacs_srcdir)/$$file" && \
726+
$(INSTALL_DATA) "$$file" "$$installed_file" && \
727+
[ -z "$(GZIP_PROG)" ] || { \
728+
rm -f "$$installed_file.gz" && \
729+
$(GZIP_PROG) -9n "$$installed_file" && \
730+
installed_file=$$installed_file.gz; \
731+
} || exit; \
732+
chown $$installuser "$$installed_file" || true; \
733+
done; \
734+
}
735+
endif
736+
710737
## Install those items from etc/ that need to end up elsewhere.
711738

712739
## If you prefer, choose "emacs22" at installation time.

configure.ac

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ locallisppath='${datadir}/emacs/${version}/site-lisp:'\
194194
lisppath='${locallisppath}:${standardlisppath}'
195195
etcdir='${datadir}/emacs/${version}/etc'
196196
archlibdir='${libexecdir}/emacs/${version}/${configuration}'
197+
emacs_srcdir='${datadir}/emacs/${version}'
197198
etcdocdir='${datadir}/emacs/${version}/etc'
198199
gamedir='${localstatedir}/games/emacs'
199200

@@ -540,6 +541,15 @@ elif test "${enableval}" != "yes"; then
540541
locallisppath=${enableval} locallisppathset=yes
541542
fi)
542543

544+
AC_ARG_ENABLE([install-srcdir],
545+
[AS_HELP_STRING([--disable-install-srcdir],
546+
[do not install low-level Emacs source code useful for debugging.])],
547+
[case $enableval in
548+
yes) ;;
549+
no) emacs_srcdir=;;
550+
*) AC_MSG_ERROR([invalid install-srcdir]);;
551+
esac])
552+
543553
AC_ARG_ENABLE(checking,
544554
[AS_HELP_STRING([--enable-checking@<:@=LIST@:>@],
545555
[enable expensive checks. With LIST,
@@ -2050,6 +2060,9 @@ if test "${HAVE_NS}" = yes; then
20502060
dnl This one isn't really used, only archlibdir is.
20512061
libexecdir="\${ns_appbindir}/libexec"
20522062
archlibdir="\${ns_appbindir}/libexec"
2063+
case $emacs_srcdir in
2064+
?*) emacs_srcdir="\${ns_appresdir}";;
2065+
esac
20532066
etcdocdir="\${ns_appresdir}/etc"
20542067
etcdir="\${ns_appresdir}/etc"
20552068
dnl FIXME maybe set datarootdir instead.
@@ -5300,6 +5313,7 @@ AC_SUBST(lisppath)
53005313
AC_SUBST(x_default_search_path)
53015314
AC_SUBST(etcdir)
53025315
AC_SUBST(archlibdir)
5316+
AC_SUBST([emacs_srcdir])
53035317
AC_SUBST(etcdocdir)
53045318
AC_SUBST(bitmapdir)
53055319
AC_SUBST(gamedir)

doc/lispref/os.texi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,8 @@ following form:
16891689
@noindent
16901690
The format of this list is the same as what @code{decode-time} accepts
16911691
(@pxref{Time Conversion}), and is described in more detail there. Any
1692-
element that cannot be determined from the input will be set to
1692+
@code{dst} element that cannot be determined from the input is set to
1693+
@minus{}1, and any other unknown element is set to
16931694
@code{nil}. The argument @var{string} should resemble an RFC 822 (or later) or
16941695
ISO 8601 string, like ``Fri, 25 Mar 2016 16:24:56 +0100'' or
16951696
``1998-09-12T12:21:54-0200'', but this function will attempt to parse

etc/NEWS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ shaping, so 'configure' now recommends that combination.
5858
** The ftx font backend driver has been removed.
5959
It was declared obsolete in Emacs 27.1.
6060

61+
---
62+
** Emacs now installs a copy of its C source code, used for debugging help.
63+
For example, pressing the first button in the *Help* buffer generated
64+
by 'C-h f car RET' now takes you to a copy of the C-language
65+
implementation of the function 'car'.
66+
6167

6268
* Startup Changes in Emacs 28.1
6369

@@ -142,6 +148,10 @@ called when the function object is garbage-collected. Use
142148
** 'parse-time-string' can now parse ISO 8601 format strings,
143149
such as "2020-01-15T16:12:21-08:00".
144150

151+
** The new variable 'emacs-source-directory' gives the location of
152+
a copy of the Emacs source code, which is now typically installed as a
153+
set of compressed source-code files.
154+
145155

146156
* Changes in Emacs 28.1 on Non-Free Operating Systems
147157

lisp/calendar/iso8601.el

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ See `decode-time' for the meaning of FORM."
136136
(when zone-string
137137
(setf (decoded-time-zone date)
138138
;; The time zone in decoded times are in seconds.
139-
(* (iso8601-parse-zone zone-string) 60)))
139+
(* (iso8601-parse-zone zone-string) 60))
140+
(setf (decoded-time-dst date) nil))
140141
date)))
141142

142143
(defun iso8601-parse-date (string)
@@ -332,6 +333,9 @@ Return the number of minutes."
332333
(list start end
333334
(or duration
334335
;; FIXME: Support subseconds.
336+
;; FIXME: It makes no sense to decode a time difference
337+
;; according to (decoded-time-zone end), or according to
338+
;; any other time zone for that matter.
335339
(decode-time (time-subtract (iso8601--encode-time end)
336340
(iso8601--encode-time start))
337341
(or (decoded-time-zone end) 0) 'integer)))))
@@ -354,7 +358,7 @@ Return the number of minutes."
354358
(iso8601--value month)
355359
(iso8601--value year)
356360
nil
357-
dst
361+
(if (or dst zone) dst -1)
358362
zone))
359363

360364
(defun iso8601--encode-time (time)

lisp/calendar/parse-time.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ The values returned are identical to those of `decode-time', but
158158
any unknown values other than DST are returned as nil, and an
159159
unknown DST value is returned as -1."
160160
(condition-case ()
161-
(decoded-time-set-defaults (iso8601-parse string))
161+
(iso8601-parse string)
162162
(wrong-type-argument
163163
(let ((time (list nil nil nil nil nil nil nil -1 nil))
164164
(temp (parse-time-tokenize (downcase string))))

lisp/calendar/time-date.el

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -515,15 +515,14 @@ TIME is modified and returned."
515515
(unless (decoded-time-year time)
516516
(setf (decoded-time-year time) 0))
517517

518-
;; When we don't have a time zone and we don't have a DST, then mark
519-
;; it as unknown.
520-
(when (and (not (decoded-time-zone time))
521-
(not (decoded-time-dst time)))
522-
(setf (decoded-time-dst time) -1))
523-
524-
(when (and (not (decoded-time-zone time))
525-
default-zone)
526-
(setf (decoded-time-zone time) 0))
518+
;; When we don't have a time zone, default to DEFAULT-ZONE without
519+
;; DST if DEFAULT-ZONE if given, and to unknown DST otherwise.
520+
(unless (decoded-time-zone time)
521+
(if default-zone
522+
(progn (setf (decoded-time-zone time) default-zone)
523+
(setf (decoded-time-dst time) nil))
524+
(setf (decoded-time-dst time) -1)))
525+
527526
time)
528527

529528
(provide 'time-date)

0 commit comments

Comments
 (0)