From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Hanchrow Newsgroups: gmane.emacs.bugs Subject: bug#32418: 26.1; M-C-q with lsp-python leaves point at beginning of buffer Date: Fri, 10 Aug 2018 14:09:30 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000008032d605731b2940" X-Trace: blaine.gmane.org 1533935287 10232 195.159.176.226 (10 Aug 2018 21:08:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 10 Aug 2018 21:08:07 +0000 (UTC) To: 32418@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 10 23:08:03 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1foEde-0002ZJ-HV for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Aug 2018 23:08:02 +0200 Original-Received: from localhost ([::1]:58011 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1foEfl-0007Bl-4w for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Aug 2018 17:10:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1foEfd-0007BT-Nj for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2018 17:10:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1foEfb-0000GC-Qi for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2018 17:10:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42650) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1foEfb-0000Ff-Fn for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2018 17:10:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1foEfb-0005Yt-7s for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2018 17:10:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Hanchrow Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Aug 2018 21:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 32418 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.153393539721355 (code B ref -1); Fri, 10 Aug 2018 21:10:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Aug 2018 21:09:57 +0000 Original-Received: from localhost ([127.0.0.1]:47668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1foEfU-0005YL-S5 for submit@debbugs.gnu.org; Fri, 10 Aug 2018 17:09:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38091) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1foEfS-0005Y6-Je for submit@debbugs.gnu.org; Fri, 10 Aug 2018 17:09:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1foEfK-0008Ec-TH for submit@debbugs.gnu.org; Fri, 10 Aug 2018 17:09:48 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:39838) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1foEfK-0008EL-PQ for submit@debbugs.gnu.org; Fri, 10 Aug 2018 17:09:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1foEfI-0007BC-IJ for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2018 17:09:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1foEfG-00089T-Fq for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2018 17:09:44 -0400 Original-Received: from mail-qk0-x22f.google.com ([2607:f8b0:400d:c09::22f]:42772) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1foEfG-00088l-8G for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2018 17:09:42 -0400 Original-Received: by mail-qk0-x22f.google.com with SMTP id 13-v6so7316988qkl.9 for ; Fri, 10 Aug 2018 14:09:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=AB2VAodaGJ3VIQtE2+2/gx5D4kB2EICEBrJgd1/YLWs=; b=E4SoaZrkN5Tr2h3G8nLHgbyA/RjAUC/M3HM29XCA+lj9bn6wVc+Tpy1TWtPCvNsPUg 9FCwsWKi/ygyU7jMyWIDXnwC2Ej7ctMECrNEwYoqjsDktycAurKw7R1bZSTJc/fOF6uM GzTXXCjW5IcUMhhLXbPZVzICjTHJ2q76Pp8tKsvNDDDD4u4VXEDm0cnfyRZxyHEu2jwb fT/jAS9JB4dCGS2NUGeMoKpnA0WwMQsCFyz4bvbZ46KBs8X2SLOEFMWOb6Lh+pRqaKYd RUMe0GKpbEI/lTe+TFIs0tJEyPAB/IFZyXlsgxd49qRcOBMo7V0ig2XOtxp5kzwupeHD tOhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=AB2VAodaGJ3VIQtE2+2/gx5D4kB2EICEBrJgd1/YLWs=; b=sCki42+zcMZkeP3uPeajDKIghOhkCsYnSiv7hfo4batmoDh5NOi+n0dyy4+oGm2tI1 craSBa4ZOHZbBmlf2exCeOAVbO66Iy3RVXFT56V7WxYDC7hzdaGmhZh3CP3lj03527rq f6T+ayb+BOxGvta9HV87a+VbZL9DVOFPVKXz9pU91o5Dn23RKE6rz5gomlM/cVBxsJm+ J3+z5D8KFuOLRyL66Y0M6FsnGCxbR4dJB6uniKkq7YxQvpo1kZjb2JnVFE+uVcL/VihR nK72cg2ARj7iXBayUFvi7L5pOPaKsdOQwGy8sqw/2NNPOld6SHZxmPpYtTU582VCCqGo Hopg== X-Gm-Message-State: AOUpUlEJ3fcK9Pn/VTW/Wm1J09fvkVGgZMU1ZdhOBB3WX9bpXZRyjPUu jxV9AWAdoLnUm4apr9K9tnDHdlI1bEeCsPfIdHbDAXwU40Q= X-Google-Smtp-Source: AA+uWPzzmT5cYhJT1AWbmZ5RR8d6BsU7Op3+DByLwYzvgx9XdAsJdRX7TeehXJEQSYkcGPWwnSoPH0LCdO7bptTAo9w= X-Received: by 2002:a37:a20f:: with SMTP id l15-v6mr7278784qke.329.1533935381129; Fri, 10 Aug 2018 14:09:41 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:149419 Archived-At: --0000000000008032d605731b2940 Content-Type: text/plain; charset="UTF-8" ;; mkdir ~/pyls-home ;; cd ~/pyls-home ;; python3 -m pip install --user pipenv ;; python3 -m pipenv install 'python-language-server[all]' ;; Use Emacs' package system to install both "lsp-mode" and "lsp-python" ;; start emacs with -Q ;; evaluate the following Emacs Lisp: (require 'lsp-mode) (lsp-define-stdio-client lsp-python-mode "python" (lambda () default-directory) '("bash" "-c" "cd ~/pyls-home ; python3 -m pipenv run pyls")) (add-hook 'python-mode-hook #'lsp-python-mode-enable) ;; now C-x C-f /tmp/wat.py RET, and insert into it "def wat():\n this = dict(one=1,\ntwo=2)" ;; put point just before the ( on the second line ;; type M-C-q ;; That should -- and indeed does -- indent the last line. ;; But it _also_ leaves point at the beginning of the buffer, which is wrong; it should leave it before the ( on the second line. In GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu) of 2018-05-31 built on dev-dsk-erichan-2b-i-833ca944.us-west-2.amazon.com Repository revision: 8378961cdc385a6b9a1b608e21f2329789a40cd7 Recent messages: Wrote /tmp/repro.el "def wat(): this = dict(one=1, two=2)" Char: ( (40, #o50, #x28) point=27 of 41 (63%) column=15 Mark set Saving file /tmp/repro.el... Wrote /tmp/repro.el Saving file /tmp/wat.py... Wrote /tmp/wat.py Configured using: 'configure --without-x --with-gnutls=no' Configured features: JPEG SOUND GPM NOTIFY LIBSELINUX LIBXML2 ZLIB THREADS Important settings: value of $LC_ALL: en_US.UTF-8 value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: projectile-mode: t global-magit-file-mode: t magit-auto-revert-mode: t global-git-commit-mode: t async-bytecomp-package-mode: t savehist-mode: t global-flycheck-mode: t elisp-slime-nav-mode: t shell-dirtrack-mode: t global-auto-revert-mode: t recentf-mode: t ido-everywhere: t diff-auto-refine-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug sendmail cus-edit magit-extras git-rebase align pulse dabbrev conf-mode bug-reference magit-ediff ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff vc vc-dispatcher cus-start cus-load ffap perl-mode ibuffer-projectile ruler-mode fringe scroll-bar yasnippet misearch multi-isearch pcmpl-unix projectile magit-bookmark magit-obsolete magit-blame magit-stash magit-bisect magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-collab ghub-graphql ghub url-http url-gw url-auth let-alist magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode magit-core magit-autorevert magit-process magit-margin magit-mode git-commit magit-git magit-section magit-utils crm magit-popup log-edit message rfc822 mml mml-sec epa epg mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader pcvs-util add-log with-editor async-bytecomp async server term/xterm xterm elec-pair savehist work-log-mode flycheck elisp-slime-nav etags bookmark flymake-proc flymake mwheel thingatpt python tramp-sh tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete parse-time advice edit-list pp browse-kill-ring eww mm-url gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums mail-utils mm-util mail-prsvr url-queue url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf mailcap shr image svg xml dom browse-url format-spec dired-subtree dired-hacks-utils dash wat derived autorevert recentf tree-widget wid-edit ido vc-git diff-mode ibuf-ext ibuffer ibuffer-loaddefs ibuf-macs time-date lsp-mode network-stream puny nsm rmc starttls lsp-methods em-glob esh-util inline lsp-io pcase lsp-notifications lsp-common cl filenotify url-util subr-x xref project json map dired-x dired dired-loaddefs grep compile comint ansi-color ring regexp-opt find-func edmacro kmacro warnings cl-extra help-mode face-remap tls gnutls use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode use-package-core finder-inf info tool-bar package easymenu epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib rx mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame 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 minibuffer 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 inotify multi-tty make-network-process emacs) Memory information: ((conses 16 624996 71344) (symbols 48 39729 3) (miscs 40 31263 2819) (strings 32 109320 14246) (string-bytes 1 4197129) (vectors 16 76731) (vector-slots 8 2235073 257908) (floats 8 234 2483) (intervals 56 18457 1334) (buffers 992 72) (heap 1024 49509 4044)) --0000000000008032d605731b2940 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
=C2=A0 ;; mkdir ~/pyls-home
=C2=A0 ;; c= d ~/pyls-home
=C2=A0 ;; python3 -m pip install --user pipenv
=C2=A0 ;; python3 -m pipenv install 'python-language-server[all]&= #39;

=C2=A0 ;; Use Emacs' package system to in= stall both "lsp-mode" and "lsp-python"
=C2=A0= ;; start emacs with -Q
=C2=A0 ;; evaluate the following Emacs Li= sp:

=C2=A0 (require 'lsp-mode)
=C2= =A0 (lsp-define-stdio-client
=C2=A0 =C2=A0lsp-python-mode
=C2=A0 =C2=A0"python"
=C2=A0 =C2=A0(lambda () defaul= t-directory)
=C2=A0 =C2=A0'("bash" "-c" &= quot;cd ~/pyls-home ; python3 -m pipenv run pyls"))
=C2=A0 (= add-hook 'python-mode-hook #'lsp-python-mode-enable)

=
=C2=A0 ;; now C-x C-f /tmp/wat.py RET, and insert into it
<= div>
=C2=A0 "def wat():\n=C2=A0 =C2=A0 this =3D dict(one= =3D1,\ntwo=3D2)"

=C2=A0 ;; put point just bef= ore the ( on the second line

=C2=A0 ;; type M-C-q<= /div>

=C2=A0 ;; That should -- and indeed does -- indent= the last line.
=C2=A0 ;; But it _also_ leaves point at the begin= ning of the buffer, which is wrong; it should leave it before the ( on the = second line.



In GNU = Emacs 26.1 (build 1, x86_64-pc-linux-gnu)
Repositor= y revision: 8378961cdc385a6b9a1b608e21f2329789a40cd7
Recent messa= ges:
Wrote /tmp/repro.el
"def wat():
=C2= =A0 =C2=A0 this =3D dict(one=3D1,
two=3D2)"
Char: = ( (40, #o50, #x28) point=3D27 of 41 (63%) column=3D15
Mark set
Saving file /tmp/repro.el...
Wrote /tmp/repro.el
Saving file /tmp/wat.py...
Wrote /tmp/wat.py

Configured using:
=C2=A0'configure --without-x --with-= gnutls=3Dno'

Configured features:
JP= EG SOUND GPM NOTIFY LIBSELINUX LIBXML2 ZLIB THREADS

Important settings:
=C2=A0 value of $LC_ALL: en_US.UTF-8
<= div>=C2=A0 value of $LANG: en_US.UTF-8
=C2=A0 locale-coding-syste= m: utf-8-unix

Major mode: Emacs-Lisp
Minor modes in effect:
=C2=A0 projectile-mode: t
=C2=A0 global-magit-file-mode: t
=C2=A0 magit-auto-revert-m= ode: t
=C2=A0 global-git-commit-mode: t
=C2=A0 async-by= tecomp-package-mode: t
=C2=A0 savehist-mode: t
=C2=A0 g= lobal-flycheck-mode: t
=C2=A0 elisp-slime-nav-mode: t
= =C2=A0 shell-dirtrack-mode: t
=C2=A0 global-auto-revert-mode: t
=C2=A0 recentf-mode: t
=C2=A0 ido-everywhere: t
=C2=A0 diff-auto-refine-mode: t
=C2=A0 override-global-mode: t<= /div>
=C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 eldoc-mode: t
=C2=A0 file-name-shadow-mode: t
<= div>=C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-mode: t
=C2=A0 auto-composition-mode: t
=C2=A0 auto-encryption-mode= : t
=C2=A0 auto-compression-mode: t
=C2=A0 line-number-= mode: t
=C2=A0 transient-mark-mode: t

Lo= ad-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail cus-edit magit-extras
git-rebase align pulse dabbrev conf-mode bug-reference magit-ediff
ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init<= /div>
ediff-util ediff vc vc-dispatcher cus-start cus-load ffap perl-mo= de
ibuffer-projectile ruler-mode fringe scroll-bar yasnippet mise= arch
multi-isearch pcmpl-unix projectile magit-bookmark magit-obs= olete
magit-blame magit-stash magit-bisect magit-remote magit-com= mit
magit-sequence magit-notes magit-worktree magit-tag magit-mer= ge
magit-branch magit-reset magit-collab ghub-graphql ghub url-ht= tp url-gw
url-auth let-alist magit-files magit-refs magit-status = magit magit-repos
magit-apply magit-wip magit-log which-func imen= u magit-diff smerge-mode
magit-core magit-autorevert magit-proces= s magit-margin magit-mode
git-commit magit-git magit-section magi= t-utils crm magit-popup log-edit
message rfc822 mml mml-sec epa e= pg mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gm= m-utils mailheader pcvs-util add-log
with-editor async-bytecomp a= sync server term/xterm xterm elec-pair
savehist work-log-mode fly= check elisp-slime-nav etags bookmark
flymake-proc flymake mwheel = thingatpt python tramp-sh tramp tramp-compat
tramp-loaddefs tramp= ver ucs-normalize shell pcomplete parse-time advice
edit-list pp = browse-kill-ring eww mm-url gnus nnheader gnus-util rmail
rmail-l= oaddefs rfc2047 rfc2045 ietf-drums mail-utils mm-util mail-prsvr
= url-queue url url-proxy url-privacy url-expand url-methods url-history
url-cookie url-domsuf mailcap shr image svg xml dom browse-url
<= div>format-spec dired-subtree dired-hacks-utils dash wat derived autorevert=
recentf tree-widget wid-edit ido vc-git diff-mode ibuf-ext ibuff= er
ibuffer-loaddefs ibuf-macs time-date lsp-mode network-stream p= uny nsm
rmc starttls lsp-methods em-glob esh-util inline lsp-io p= case
lsp-notifications lsp-common cl filenotify url-util subr-x x= ref project
json map dired-x dired dired-loaddefs grep compile co= mint ansi-color
ring regexp-opt find-func edmacro kmacro warnings= cl-extra help-mode
face-remap tls gnutls use-package use-package= -ensure use-package-delight
use-package-diminish use-package-bind= -key bind-key easy-mmode
use-package-core finder-inf info tool-ba= r package easymenu epg-config
url-handlers url-parse auth-source = cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache url= -vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-= lib rx mule-util tooltip eldoc
electric uniquify ediff-hook vc-ho= oks lisp-float-type tabulated-list
replace newcomment text-mode e= lisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow = isearch timer select mouse jit-lock font-lock
syntax facemenu fon= t-core term/tty-colors frame cl-generic cham georgian
utf-8-lang = misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eu= cjp-ms cp51932 hebrew greek romanian slovak czech european
ethiop= ic indian cyrillic chinese composite charscript charprop
case-tab= le epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
c= l-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 inotify multi-tty
=
make-network-process emacs)

Memory informatio= n:
((conses 16 624996 71344)
=C2=A0(symbols 48 39729 3)=
=C2=A0(miscs 40 31263 2819)
=C2=A0(strings 32 109320 1= 4246)
=C2=A0(string-bytes 1 4197129)
=C2=A0(vectors 16 = 76731)
=C2=A0(vector-slots 8 2235073 257908)
=C2=A0(flo= ats 8 234 2483)
=C2=A0(intervals 56 18457 1334)
=C2=A0(= buffers 992 72)
=C2=A0(heap 1024 49509 4044))

--0000000000008032d605731b2940--