unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Carlos Pita <carlosjosepita@gmail.com>
To: 19650@debbugs.gnu.org
Cc: Fabian Ezequiel Gallina <galli.87@gmail.com>
Subject: bug#19650:
Date: Mon, 2 Feb 2015 16:29:31 -0300	[thread overview]
Message-ID: <CAELgYhdaCXBwAEJzDY2vsOJwJmkpqrwGnqB1jgM6nz+KrZMKvg@mail.gmail.com> (raw)
In-Reply-To: <CAELgYhfgE6WGj0_FjUzb=k=PvNihTbVirWV31syFmi_iAaoSEw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 81 bytes --]

Patch updated against current master (954ca0f017f62f52ee679f2aa68effb20c917278).

[-- Attachment #2: hippie.patch --]
[-- Type: text/x-patch, Size: 3050 bytes --]

From ff40570650c060b91c3939c80b5172ac4b01be82 Mon Sep 17 00:00:00 2001
From: memeplex <carlosjosepita@gmail.com>
Date: Thu, 22 Jan 2015 17:18:34 -0300
Subject: [PATCH] python.el: fix
 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19650

---
 .emacs.d/lisp/python.el | 43 +++++++++++++++++++++++++------------------
 1 file changed, 25 insertions(+), 18 deletions(-)

diff --git a/.emacs.d/lisp/python.el b/.emacs.d/lisp/python.el
index d340550..2963706 100644
--- a/.emacs.d/lisp/python.el
+++ b/.emacs.d/lisp/python.el
@@ -2364,24 +2364,31 @@ goes wrong and syntax highlighting in the shell gets messed up."
             (buffer-undo-list t))
         ;; When input hasn't changed, do nothing.
         (when (not (string= input old-input))
-          (delete-region (cdr (python-util-comint-last-prompt)) (point-max))
-          (insert
-           (python-shell-font-lock-with-font-lock-buffer
-             (delete-region (line-beginning-position)
-                            (line-end-position))
-             (insert input)
-             ;; Ensure buffer is fontified, keeping it
-             ;; compatible with Emacs < 24.4.
-             (if (fboundp 'font-lock-ensure)
-                 (funcall 'font-lock-ensure)
-               (font-lock-default-fontify-buffer))
-             ;; Replace FACE text properties with FONT-LOCK-FACE so
-             ;; they are not overwritten by comint buffer's font lock.
-             (python-util-text-properties-replace-name
-              'face 'font-lock-face)
-             (buffer-substring (line-beginning-position)
-                               (line-end-position))))
-          (goto-char current-point))))))
+          (let ((beg) (end))
+            (when (featurep 'hippie-exp)
+              (setq beg (marker-position he-string-beg)
+                    end (marker-position he-string-end)))
+            (delete-region (cdr (python-util-comint-last-prompt)) (point-max))
+            (insert
+             (python-shell-font-lock-with-font-lock-buffer
+               (delete-region (line-beginning-position)
+                              (line-end-position))
+               (insert input)
+               ;; Ensure buffer is fontified, keeping it
+               ;; compatible with Emacs < 24.4.
+               (if (fboundp 'font-lock-ensure)
+                   (funcall 'font-lock-ensure)
+                 (font-lock-default-fontify-buffer))
+               ;; Replace FACE text properties with FONT-LOCK-FACE so
+               ;; they are not overwritten by comint buffer's font lock.
+               (python-util-text-properties-replace-name
+                'face 'font-lock-face)
+               (buffer-substring (line-beginning-position)
+                                 (line-end-position))))
+            (when (featurep 'hippie-exp)
+              (set-marker he-string-beg beg)
+              (set-marker he-string-end end))
+            (goto-char current-point)))))))
 
 (defun python-shell-font-lock-turn-on (&optional msg)
   "Turn on shell font-lock.
-- 
2.2.1


  parent reply	other threads:[~2015-02-02 19:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 22:47 bug#19650: 25.0.50; python-shell-font-lock-post-command-hook breaks hippie-expand Carlos Pita
2015-01-22 16:42 ` bug#19650: Carlos Pita
     [not found]   ` <jwvpp8eujc3.fsf-monnier+emacsbugs@gnu.org>
2015-03-13  1:19     ` bug#19650: Stefan Monnier
2015-02-02 19:29 ` Carlos Pita [this message]
2015-02-08  3:28 ` bug#19650: 25.0.50; python-shell-font-lock-post-command-hook breaks hippie-expand Fabián Ezequiel Gallina
     [not found] ` <handler.19650.D19650.142336612525392.notifdone@debbugs.gnu.org>
2015-02-09 14:12   ` bug#19650: closed (25.0.50; python-shell-font-lock-post-command-hook breaks hippie-expand) Carlos Pita
2015-02-10  2:45 ` bug#19650: 25.0.50; python-shell-font-lock-post-command-hook breaks hippie-expand Fabián Ezequiel Gallina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAELgYhdaCXBwAEJzDY2vsOJwJmkpqrwGnqB1jgM6nz+KrZMKvg@mail.gmail.com \
    --to=carlosjosepita@gmail.com \
    --cc=19650@debbugs.gnu.org \
    --cc=galli.87@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).