[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20732: in-string-p fails

From: Andreas Röhler
Subject: bug#20732: in-string-p fails
Date: Fri, 05 Jun 2015 12:34:54 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Am 05.06.2015 um 08:01 schrieb Andreas Röhler:

Meanwhile think calling "widen" here is a mistake. Rather accept narrowing might change the buffers state WRT in-string-p

Here the corrected forms:

(defun ar-in-string-p ()
  "Return position, if inside or at opening delimiter.

Otherwise return nil. "
  (let* ((pps (parse-partial-sexp (point-min) (point)))
     (erg (and (nth 3 pps) (nth 8 pps)))
     (la (unless erg (when (eq (char-syntax (char-after)) 34)
    (setq erg (or erg la))
    (when (interactive-p) (message "%s" erg))

(defun ar-in-string-p-fast ()
  "Returns start position if inside, nil otherwise. "
  (ignore-errors (nth 8 (parse-partial-sexp (point-min) (point)))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]