[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 5056b8e5897: Merge from origin/emacs-29
From: |
Stefan Kangas |
Subject: |
master 5056b8e5897: Merge from origin/emacs-29 |
Date: |
Thu, 9 Mar 2023 00:45:31 -0500 (EST) |
branch: master
commit 5056b8e589753698ce7ee935980ca03de0e41bf5
Merge: da4f1fa550f 7e1012765c4
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>
Merge from origin/emacs-29
7e1012765c4 Fix libwebp check for some webp installations
c2ca009da4c Avoid potential infloop
34c14430e9d Don't misindent 'else:' after 'if re.match:' in Python
8a2a554192a * Make sure `default-directory' exists before spawning pr...
1862e7eb7ef Fix sed expression in install-etc make target
c8ec0017cb9 Avoid using bash in the emacsclient desktop file
a588937094f Fix documentation of the 'line-height' text property
971ded31c4f Add 'declare' specs to with- and without-restriction
---
Makefile.in | 4 ++--
configure.ac | 19 +++++++++++++++++++
doc/lispref/display.texi | 13 ++++++++-----
etc/emacsclient-mail.desktop | 6 +++---
lisp/emacs-lisp/comp.el | 4 +++-
lisp/progmodes/python.el | 4 +++-
lisp/subr.el | 2 ++
test/lisp/progmodes/python-tests.el | 12 ++++++++++++
8 files changed, 52 insertions(+), 12 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 2fb7754d683..4f2f2f15c97 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -841,7 +841,7 @@ install-etc:
rm -f $${tmp}
tmp=etc/emacsclient.tmpdesktop; rm -f $${tmp}; \
client_name=`echo emacsclient | sed '$(TRANSFORM)'`${EXEEXT}; \
- sed -e "/^Exec=emacsclient/ s|emacsclient|${bindir}/$${client_name}|" \
+ sed -e "/^Exec=/ s|emacsclient|${bindir}/$${client_name}|" \
-e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \
$(USE_STARTUP_NOTIFICATION_SED_CMD) \
${srcdir}/etc/emacsclient.desktop > $${tmp}; \
@@ -855,7 +855,7 @@ install-etc:
rm -f $${tmp}
tmp=etc/emacsclient-mail.tmpdesktop; rm -f $${tmp}; \
client_name=`echo emacsclient | sed '$(TRANSFORM)'`${EXEEXT}; \
- sed -e "/^Exec=emacsclient/ s|emacsclient|${bindir}/$${client_name}|" \
+ sed -e "/^Exec=/ s|emacsclient|${bindir}/$${client_name}|" \
-e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \
${srcdir}/etc/emacsclient-mail.desktop > $${tmp}; \
${INSTALL_DATA} $${tmp}
"$(DESTDIR)${desktopdir}/$${client_name}-mail.desktop"; \
diff --git a/configure.ac b/configure.ac
index b484ebdc8ba..25afe3a6981 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2776,6 +2776,25 @@ if test "${with_webp}" != "no"; then
WEBP_MODULE="libwebpdemux >= $WEBP_REQUIRED"
EMACS_CHECK_MODULES([WEBP], [$WEBP_MODULE])
+
+ # WebPGetInfo is sometimes not present inside libwebpdemux, so
+ # if it does not link, also check for libwebpdecoder.
+
+ OLD_CFLAGS=$CFLAGS
+ OLD_LIBS=$LIBS
+ CFLAGS="$CFLAGS $WEBP_CFLAGS"
+ LIBS="$LIBS $WEBP_LIBS"
+
+ AC_CHECK_FUNC([WebPGetInfo], [],
+ [WEBP_MODULE="$WEBP_MODULE libwebpdecoder >= $WEBP_REQUIRED"
+ HAVE_WEBP=no
+ AS_UNSET([WEBP_LIBS])
+ AS_UNSET([WEBP_CFLAGS])
+ EMACS_CHECK_MODULES([WEBP], [$WEBP_MODULE])])
+
+ CFLAGS=$OLD_CFLAGS
+ LIBS=$OLD_LIBS
+
AC_SUBST([WEBP_CFLAGS])
AC_SUBST([WEBP_LIBS])
fi
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index a8311f5c9a2..550d711c73a 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -2345,10 +2345,11 @@ newline. The property value can be one of several
forms:
@item t
If the property value is @code{t}, the newline character has no
effect on the displayed height of the line---the visible contents
-alone determine the height. The @code{line-spacing} property,
-described below, is also ignored in this case. This is useful for
-tiling small images (or image slices) without adding blank areas
-between the images.
+alone determine the height. The @code{line-spacing} property of the
+newline, described below, is also ignored in this case. This is
+useful for tiling small images (or image slices) without adding blank
+areas between the images.
+
@item (@var{height} @var{total})
If the property value is a list of the form shown, that adds extra
space @emph{below} the display line. First Emacs uses @var{height} as
@@ -2409,7 +2410,9 @@ overrides line spacings specified for the frame.
property that can enlarge the default frame line spacing and the
buffer local @code{line-spacing} variable: if its value is larger than
the buffer or frame defaults, that larger value is used instead, for
-the display line ending in that newline.
+the display line ending in that newline (unless the newline also has
+the @code{line-height} property whose value is one of the special
+values which cause @code{line-spacing} to be ignored, see above).
One way or another, these mechanisms specify a Lisp value for the
spacing of each line. The value is a height spec, and it translates
diff --git a/etc/emacsclient-mail.desktop b/etc/emacsclient-mail.desktop
index 49c6f99f317..0a2420ddead 100644
--- a/etc/emacsclient-mail.desktop
+++ b/etc/emacsclient-mail.desktop
@@ -2,9 +2,9 @@
Categories=Network;Email;
Comment=GNU Emacs is an extensible, customizable text editor - and more
# We want to pass the following commands to the shell wrapper:
-# u=${1//\\/\\\\}; u=${u//\"/\\\"}; exec emacsclient --alternate-editor=
--display="$DISPLAY" --eval "(message-mailto \"$u\")"
+# u=$(echo "$1" | sed 's/[\"]/\\&/g'); exec emacsclient --alternate-editor=
--display="$DISPLAY" --eval "(message-mailto \"$u\")"
# Special chars '"', '$', and '\' must be escaped as '\\"', '\\$', and '\\\\'.
-Exec=bash -c "u=\\${1//\\\\\\\\/\\\\\\\\\\\\\\\\};
u=\\${u//\\\\\\"/\\\\\\\\\\\\\\"}; exec emacsclient --alternate-editor=
--display=\\"\\$DISPLAY\\" --eval \\"(message-mailto \\\\\\"\\$u\\\\\\")\\""
bash %u
+Exec=sh -c "u=\\$(echo \\"\\$1\\" | sed 's/[\\\\\\"]/\\\\\\\\&/g'); exec
emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" --eval
\\"(message-mailto \\\\\\"\\$u\\\\\\")\\"" sh %u
Icon=emacs
Name=Emacs (Mail, Client)
MimeType=x-scheme-handler/mailto;
@@ -16,7 +16,7 @@ Actions=new-window;new-instance;
[Desktop Action new-window]
Name=New Window
-Exec=bash -c "u=\\${1//\\\\\\\\/\\\\\\\\\\\\\\\\};
u=\\${u//\\\\\\"/\\\\\\\\\\\\\\"}; exec emacsclient --alternate-editor=
--create-frame --eval \\"(message-mailto \\\\\\"\\$u\\\\\\")\\"" bash %u
+Exec=sh -c "u=\\$(echo \\"\\$1\\" | sed 's/[\\\\\\"]/\\\\\\\\&/g'); exec
emacsclient --alternate-editor= --create-frame --eval \\"(message-mailto
\\\\\\"\\$u\\\\\\")\\"" sh %u
[Desktop Action new-instance]
Name=New Instance
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index ce81680a226..9f4118dfc86 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -3726,7 +3726,8 @@ Prepare every function for final compilation and drive
the C back-end."
(temp-file (make-temp-file
(concat "emacs-int-comp-"
(file-name-base output) "-")
- nil ".el")))
+ nil ".el"))
+ (default-directory invocation-directory))
(with-temp-file temp-file
(insert ";; -*-coding: utf-8-emacs-unix; -*-\n")
(mapc (lambda (e)
@@ -4023,6 +4024,7 @@ display a message."
(comp-log "\n")
(mapc #'comp-log expr-strings)))
(load1 load)
+ (default-directory invocation-directory)
(process (make-process
:name (concat "Compiling: " source-file)
:buffer (with-current-buffer
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 1f970633bfc..630250c15c3 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -5792,7 +5792,9 @@ likely an invalid python file."
(catch 'exit
(while (python-nav--syntactically
(lambda ()
- (re-search-backward (python-rx block-start) nil t))
+ (cl-loop while (re-search-backward (python-rx
block-start) nil t)
+ if (memq (char-before) '(nil ?\s ?\t ?\n))
+ return t))
#'<)
(let ((indentation (current-indentation)))
(when (and (not (memq indentation collected-indentations))
diff --git a/lisp/subr.el b/lisp/subr.el
index e29c8ddd6c4..40bec544b73 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4051,6 +4051,7 @@ to other portions of the buffer, use
`without-restriction' with the
same LABEL argument.
\(fn START END [:label LABEL] BODY)"
+ (declare (indent 0) (debug t))
(if (eq (car rest) :label)
`(internal--with-restriction ,start ,end (lambda () ,@(cddr rest))
,(cadr rest))
@@ -4073,6 +4074,7 @@ restrictions set by `with-restriction' with the same
LABEL argument
are lifted.
\(fn [:label LABEL] BODY)"
+ (declare (indent 0) (debug t))
(if (eq (car rest) :label)
`(internal--without-restriction (lambda () ,@(cddr rest))
,(cadr rest))
diff --git a/test/lisp/progmodes/python-tests.el
b/test/lisp/progmodes/python-tests.el
index 4f24c042c6a..6928e313dc4 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -1982,6 +1982,18 @@ match foo:
(should (eq (car (python-indent-context)) :after-block-start))
(should (= (python-indent-calculate-indentation) 8))))
+(ert-deftest python-indent-after-re-match ()
+ "Test BUG 62031 regression."
+ (python-tests-with-temp-buffer
+ "
+def test_re(string):
+ if re.match('^[a-c]+$', string):
+ print('yes')
+ else:
+ "
+ (python-tests-look-at "else:")
+ (should (= (python-indent-calculate-indentation) 4))))
+
;;; Filling