From bb5576fc9071590143af2106111d95ca2221a20c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 31 Aug 2024 12:58:39 +0300 Subject: [PATCH 1/4] Work around Gnuplot bug in displaying plots * lisp/calc/calc-graph.el (calc-gnuplot-command): Prepend newline to Gnuplot command. Suggested by Visuwesh . (Bug#72778) --- lisp/calc/calc-graph.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el index fb817b1bc3d..804ee3944c7 100644 --- a/lisp/calc/calc-graph.el +++ b/lisp/calc/calc-graph.el @@ -1417,7 +1417,9 @@ This \"dumb\" driver will be present in Gnuplot 3.0." "Send ARGS to Gnuplot. Returns nil if Gnuplot signaled an error." (calc-graph-init) - (let ((cmd (concat (mapconcat 'identity args " ") "\n"))) + ;; We prepend the newline to work around a bug in Gnuplot, whereby it + ;; sometimes does not display the plot, see bug#72778. + (let ((cmd (concat "\n" (mapconcat 'identity args " ") "\n"))) (or (calc-graph-w32-p) (accept-process-output)) (with-current-buffer calc-gnuplot-buffer From 4f521fa14c18f57e5207bffd68e9f79454dccc79 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 26 Aug 2024 11:47:25 -0700 Subject: [PATCH 2/4] Fix handling of hook variables in 'use-package' * lisp/use-package/use-package-core.el (use-package-handler/:hook): Append "-hook" to the symbol's name only if the named hook variable has no 'symbol-value'. (Bug#72818) --- lisp/use-package/use-package-core.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index 7148c334126..2c5fc560749 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el @@ -1376,11 +1376,13 @@ enable gathering statistics." (when fun (mapcar #'(lambda (sym) - `(add-hook - (quote ,(intern - (concat (symbol-name sym) - use-package-hook-name-suffix))) - (function ,fun))) + (if (boundp sym) + `(add-hook (quote ,sym) (function ,fun)) + `(add-hook + (quote ,(intern + (concat (symbol-name sym) + use-package-hook-name-suffix))) + (function ,fun)))) (use-package-hook-handler-normalize-mode-symbols syms))))) (use-package-normalize-commands args)))) From e27849ecf6ee01f6d02ef2785d0c10e32bc764e9 Mon Sep 17 00:00:00 2001 From: Evgenii Klimov Date: Sun, 25 Feb 2024 20:12:38 +0000 Subject: [PATCH 3/4] Avoid ANSI escape characters in Python output (bug#45938) * lisp/progmodes/python.el (python-shell-completion-native-setup): Prevent Readline from emitting escape characters in comint output. --- lisp/progmodes/python.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 692d915f8f8..227be64b5b0 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -4549,6 +4549,9 @@ def __PYTHON_EL_native_completion_setup(): readline.parse_and_bind('tab: complete') # Require just one tab to send output. readline.parse_and_bind('set show-all-if-ambiguous on') + # Avoid ANSI escape characters in the output + readline.parse_and_bind('set colored-completion-prefix off') + readline.parse_and_bind('set colored-stats off') # Avoid replacing common prefix with ellipsis. readline.parse_and_bind('set completion-prefix-display-length 0') From 5fd75133cfe389004f9fca8f11e093e531c45fe2 Mon Sep 17 00:00:00 2001 From: Evgenii Klimov Date: Thu, 29 Aug 2024 23:36:12 +0100 Subject: [PATCH 4/4] Make 'python-shell--with-environment' respect buffer-local vars * lisp/progmodes/python.el (python-shell--with-environment): Make `with-temp-buffer' respect buffer-local values of `process-environment' and `exec-path', if set. (Bug#72849) --- lisp/progmodes/python.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 227be64b5b0..a50446343a0 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3030,11 +3030,11 @@ machine then modifies `tramp-remote-process-environment' and (tramp-dissect-file-name default-directory 'noexpand))))) (if vec (python-shell--tramp-with-environment vec extraenv bodyfun) - (let ((process-environment - (append extraenv process-environment)) - (exec-path - ;; FIXME: This is still Python-specific. - (python-shell-calculate-exec-path))) + (cl-letf (((default-value 'process-environment) + (append extraenv process-environment)) + ((default-value 'exec-path) + ;; FIXME: This is still Python-specific. + (python-shell-calculate-exec-path))) (funcall bodyfun))))) (defun python-shell--tramp-with-environment (vec extraenv bodyfun)