unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: Luis Henriquez-Perez <luishenriquezperez@gmail.com>
Cc: 21922@debbugs.gnu.org
Subject: bug#21922: Patch for fixing the "straight-quote" case
Date: Tue, 08 Oct 2019 23:41:34 -0400	[thread overview]
Message-ID: <87y2xu7fgx.fsf@gmail.com> (raw)
In-Reply-To: <CAKVVwxe9ESd_Xwdu0vaj3C=woHSOcRS=YTvqUy61MfTs4v1jQg@mail.gmail.com> (Luis Henriquez-Perez's message of "Mon, 23 Sep 2019 23:16:40 -0400")

Luis Henriquez-Perez <luishenriquezperez@gmail.com> writes:

>  (when-let (point (char-before containing-sexp))
>    (char-equal point ?'))

>             (and (char-before point)
>                  (char-equal (char-before point) ?'))

You can use eq instead of char-equal, and then the extra check for nil
isn't needed.

>             (save-excursion
>               (goto-char (1+ point))
>               (looking-at-p "quote[\t\n\f\s]+(")))))

I would suggest (looking-at-p "[[:whitespace:]\n]*quote\_>") instead,
and maybe move the save-excursion outside of the loop.

Overall, the approach looks reasonable to me.





      reply	other threads:[~2019-10-09  3:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-14 18:29 bug#21922: Indentation of Emacs Lisp list constants is surprising Clément Pit--Claudel
2015-11-15 19:28 ` Eli Zaretskii
2015-11-16  0:33 ` Dmitry Gutov
2019-09-24  3:16 ` bug#21922: Patch for fixing the "straight-quote" case Luis Henriquez-Perez
2019-10-09  3:41   ` Noam Postavsky [this message]

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=87y2xu7fgx.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=21922@debbugs.gnu.org \
    --cc=luishenriquezperez@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).