bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#21922: Fwd: Patch for fixing "straigh-quote" case


From: Luis Henriquez-Perez
Subject: bug#21922: Fwd: Patch for fixing "straigh-quote" case
Date: Tue, 22 Oct 2019 19:40:38 -0400



---------- Forwarded message ---------
From: Luis Henriquez-Perez <luishenriquezperez@gmail.com>
Date: Tue, Oct 22, 2019 at 7:38 PM
Subject: Patch for fixing "straigh-quote" case
To: <21922@debbug.org>


I replied to your personal email instead of this thread. I thought maybe my replies had not been seen (and also that this should be recorded in the thread). So this is what I had said:

Thanks for your suggestions.

Here's what the relevant sectiion of code would look like.

(if (or
     (= (point) calculate-lisp-indent-last-sexp)

     (eq (char-after (1+ containing-sexp)) ?:)

     (eq (char-before containing-sexp) ?')

     (let ((quoted-p nil)
           (point nil)
           (positions (nreverse (butlast (elt state 9)))))
      (save-excursion
        (while (and positions (not quoted-p))
         (setq point (pop positions))
         (setq quoted-p
          (or (eq (char-before point) ?')
           (goto-char (1+ point))
           (looking-at-p "[[:space:]]*quote\\>")))))
      quoted-p))
    ;; Containing sexp has nothing before this line
    ;; except the first element.  Indent under that element.
    nil
  ;; Skip the first element, find start of second (the first
  ;; argument of the function call) and indent under.
  (progn (forward-sexp 1)
   (parse-partial-sexp (point)
    calculate-lisp-indent-last-sexp
    0 t)))

question 1:
I get an `unknown posix character class` error when I try (looking-at-p "[[:whitespace:]\n]*quote\_>").  Did you mean to use [[:space:]] instead?
Did you mean:  (looking-at-p "[[:space:]]*quote\\>")?

question 2:
The reason I used explicit whitespace character is because matches for character classes like [[:space:]] are dependent on the active syntax table in the buffer (see this issue). Not sure if this will be a problem though, what do you think?

reply via email to

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