Skip to content

Enforce case-sensitivity on all regexps #63

@loverobean

Description

@loverobean

As a long-term follow up to Issue#61, it would be best to go through all regexps in this mode and set case-fold-search nil, or perhaps to define a version of looking-at which will always be case-sensitive regardless of the value of case-fold-search.

(In this particular case, the behavior with case-folding is a little more convenient, because if a user attempts to use a lowercase letter as a flag, he can correct his mistake using beancount-transaction-clear or beancount-transaction-flag, which would not be possible if the regexp match failed.

That said, in general, the code would be more precise if every regexp match were case-sensitive.

(defun beancount-transaction-clear (&optional arg)
  "Clear transaction at point. With a prefix argument set the
transaction as pending."
  (interactive "P")
  (save-excursion
    (save-match-data
      (let ((case-fold-search nil))
      (let ((flag (if arg "!" "*")))
        (beancount-goto-transaction-begin)
        (if (looking-at beancount-transaction-regexp)
            (replace-match flag t t nil 2)))))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions