* bug#44421: 27.1; run-python's SHOW argument has no effect
@ 2020-11-03 16:10 dalanicolai
2020-11-09 16:22 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: dalanicolai @ 2020-11-03 16:10 UTC (permalink / raw)
To: 44421
Evaluate
(run-python (python-shell-calculate-command) t nil)
the last argument 'nil' should prevent that the comint buffer is shown,
but the comint buffer shows nevertheless.
The solution is simple, namely, remove the before last line
(pop-to-buffer buffer)
from the `run-pyton` function (printed below). The SHOW is already
passed to the 'python-shell-make-comint' function. The `pop-to-buffer`
makes the created comint buffer show, irrespective of the SHOW value.
(defun run-python (&optional cmd dedicated show)
"Run an inferior Python process.
Argument CMD defaults to `python-shell-calculate-command' return
value. When called interactively with `prefix-arg', it allows
the user to edit such value and choose whether the interpreter
should be DEDICATED for the current buffer. When numeric prefix
arg is other than 0 or 4 do not SHOW.
For a given buffer and same values of DEDICATED, if a process is
already running for it, it will do nothing. This means that if
the current buffer is using a global process, the user is still
able to switch it to use a dedicated one.
Runs the hook `inferior-python-mode-hook' after
`comint-mode-hook' is run. (Type \\[describe-mode] in the
process buffer for a list of commands.)"
(interactive
(if current-prefix-arg
(list
(read-shell-command "Run Python: " (python-shell-calculate-
command))
(y-or-n-p "Make dedicated process? ")
(= (prefix-numeric-value current-prefix-arg) 4))
(list (python-shell-calculate-command) nil t)))
(let ((buffer
(python-shell-make-comint
(or cmd (python-shell-calculate-command))
(python-shell-get-process-name dedicated) show)))
(pop-to-buffer buffer)
(get-buffer-process buffer)))
In GNU Emacs 27.1 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.22, cairo version 1.16.0)
of 2020-08-21 built on buildhw-x86-03.iad2.fedoraproject.org
Windowing system distributor 'Fedora Project', version 11.0.12009000
System Description: Fedora 33 (Workstation Edition)
Recent messages:
Updating /home/dalanicolai/.emacs.d/quelpa/melpa
Newer package has been installed. Not upgrading. [2 times]
Fetcher: github
Source: dalanicolai/calibredb.el
Updating /home/dalanicolai/.emacs.d/quelpa/build/calibredb/
Newer package has been installed. Not upgrading.
Loading /home/dalanicolai/.emacs.d/init.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...
Configured using:
'configure --build=x86_64-redhat-linux-gnu
--host=x86_64-redhat-linux-gnu --program-prefix=
--disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
--bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
--datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
--libexecdir=/usr/libexec --localstatedir=/var
--sharedstatedir=/var/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png
--with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3
--with-gpm=no --with-xwidgets --with-modules --with-harfbuzz
--with-cairo --with-json build_alias=x86_64-redhat-linux-gnu
host_alias=x86_64-redhat-linux-gnu CC=gcc 'CFLAGS=-DMAIL_USE_LOCKF -O2
-flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches
-pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-Wp,-D_GLIBCXX_ASSERTIONS
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
LDFLAGS=-Wl,-z,relro
PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'
Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS
LIBSYSTEMD JSON PDUMPER GMP
Important settings:
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
Major mode: Fundamental
Minor modes in effect:
override-global-mode: t
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml mml-sec epa derived epg epg-config gnus-util
rmail rmail-loaddefs text-property-search mailabbrev gmm-utils
mailheader sendmail mail-utils .emacs quelpa-use-package use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core cl-extra
parse-time iso8601 time-date quelpa mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr
lisp-mnt help-fns radix-tree help-mode finder-inf clang-rename
clang-include-fixer let-alist clang-format xml info package easymenu
browse-url url-handlers url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq
byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win
x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting xwidget-internal cairo move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)
Memory information:
((conses 16 208971 12398)
(symbols 48 14374 1)
(strings 32 71497 2903)
(string-bytes 1 1885213)
(vectors 16 20004)
(vector-slots 8 273672 11704)
(floats 8 39 25)
(intervals 56 328 0)
(buffers 1000 14))
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#44421: 27.1; run-python's SHOW argument has no effect
2020-11-03 16:10 bug#44421: 27.1; run-python's SHOW argument has no effect dalanicolai
@ 2020-11-09 16:22 ` Lars Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2020-11-09 16:22 UTC (permalink / raw)
To: dalanicolai; +Cc: 44421
dalanicolai@gmail.com writes:
> Evaluate
>
> (run-python (python-shell-calculate-command) t nil)
>
> the last argument 'nil' should prevent that the comint buffer is shown,
> but the comint buffer shows nevertheless.
>
> The solution is simple, namely, remove the before last line
>
> (pop-to-buffer buffer)
>
> from the `run-pyton` function (printed below). The SHOW is already
> passed to the 'python-shell-make-comint' function. The `pop-to-buffer`
> makes the created comint buffer show, irrespective of the SHOW value.
It seems like the reason for the pop-to-buffer there was to make the
buffer the current buffer (see bug#31398), so I've just changed it to a
set-buffer instead.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-09 16:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-03 16:10 bug#44421: 27.1; run-python's SHOW argument has no effect dalanicolai
2020-11-09 16:22 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).