all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
To: Glenn Morris <rgm@gnu.org>
Cc: "Torbjørn Lindahl" <torbjorn.lindahl@gmail.com>, 17529@debbugs.gnu.org
Subject: bug#17529: 24.3; Error in hippie-expand
Date: Mon, 19 May 2014 23:01:10 +0200	[thread overview]
Message-ID: <8738g5fppl.fsf@geodiff-mac3.ulb.ac.be> (raw)
In-Reply-To: <07iop1ohu9.fsf@fencepost.gnu.org> (Glenn Morris's message of "Mon, 19 May 2014 12:26:22 -0400")

Glenn Morris <rgm@gnu.org> writes:
> Can you do:
> M-x toggle-debug-no-error
> repeat the problem, and send the backtrace?

More details should come soon from the OP, but we managed to debug this
over IRC so I post the outcome :

First here's the backtrace :

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  buffer-substring-no-properties(nil 9745)
  he-init-string(nil 9745)
  try-expand-line(nil)
  apply(try-expand-line nil)
  hippie-expand(nil)
  call-interactively(hippie-expand record nil)
  command-execute(hippie-expand record)
  execute-extended-command(nil "hippie-expand")
  call-interactively(execute-extended-command nil nil)

This means that (he-line-beg strip-prompt) (that is called within
try-expand-line) returned nil. The reason is that it tries to collect
the 2nd group of a regexp that is not fully under control, namely
comint-prompt-regexp. In ESS, that regexp contains grouping constructs.

To avoid the problem, one solution is to replace "2" by "the last
group". The following patch thus fixes the problem for me... but (1- (/
(length (match-data)) 2)) is a bit cryptic.

--- /usr/local/share/emacs/24.3.91/lisp/hippie-exp.el.gz
+++ #<buffer hippie-exp.el.gz>
@@ -710,7 +710,7 @@
   (save-excursion
     (if (re-search-backward (he-line-search-regexp "" strip-prompt)
 			    (line-beginning-position) t)
-	(match-beginning 2)
+	(match-beginning (1- (/ (length (match-data)) 2)))
       (point))))
 
 (defun he-line-search-regexp (pat strip-prompt)

-- 
Nico.





  parent reply	other threads:[~2014-05-19 21:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-19 16:16 bug#17529: 24.3; Error in hippie-expand Torbjørn Lindahl
2014-05-19 16:26 ` Glenn Morris
2014-05-19 20:37   ` Torbjørn Lindahl
2014-05-19 20:40     ` Torbjørn Lindahl
2014-05-19 20:43       ` Torbjørn Lindahl
2014-05-19 21:01   ` Nicolas Richard [this message]
2014-05-22  6:21     ` Glenn Morris
2014-05-22 14:11       ` Stefan Monnier
2014-05-23 18:15       ` Glenn Morris

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

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

  git send-email \
    --in-reply-to=8738g5fppl.fsf@geodiff-mac3.ulb.ac.be \
    --to=theonewiththeevillook@yahoo.fr \
    --cc=17529@debbugs.gnu.org \
    --cc=rgm@gnu.org \
    --cc=torbjorn.lindahl@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.