Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Add regexp support #40

Open
snowman opened this issue May 9, 2019 · 1 comment
Open

Request: Add regexp support #40

snowman opened this issue May 9, 2019 · 1 comment

Comments

@snowman
Copy link

snowman commented May 9, 2019

Wanted

Like highlight-regexp, but with overlay functionality.

Reproduction steps

sample code extracted for illustration from https://raw.githubusercontent.com/bbatsov/prelude/master/utils/installer.sh

install_prelude() {
  printf " Cloning Emacs Prelude's GitHub repository...\n$RESET"

  if [ x$PRELUDE_VERBOSE != x ]; then
    /usr/bin/env git clone $PRELUDE_URL "$PRELUDE_INSTALL_DIR"
  else
    /usr/bin/env git clone $PRELUDE_URL "$PRELUDE_INSTALL_DIR" >/dev/null
  fi

  if ! [ $? -eq 0 ]; then
    printf "$RED A fatal error occurred during Prelude's installation. Aborting..."
    exit 1
  fi
}

make_prelude_dirs() {
  printf " Creating the required directories.\n$RESET"
  mkdir -p "$PRELUDE_INSTALL_DIR/savefile"
}

When overlay string PRELUDE_INSTALL_DIR inside "$PRELUDE_INSTALL_DIR" with symbol-overlay-put, it would not highlight $PRELUDE_INSTALL_DIR inside "$PRELUDE_INSTALL_DIR/savefile"

image

@snowman snowman closed this as completed May 9, 2019
@snowman snowman reopened this May 9, 2019
@snowman snowman changed the title Request: Overlay region or regexp? Request: Overlay regexp? Jun 16, 2019
@snowman snowman closed this as completed Dec 21, 2019
@DWgit
Copy link

DWgit commented Oct 18, 2020

Wondering if this feature was considered? Doesn't seem to be in current master branch.

In addition to @snowman's original example, matching synonyms is another use-case. It would be great to have a single symbol overlay on a regex, for example AB-?16\|XYZ, which matches three synonyms.

One possible UI would be:

  1. yank symbol at point into the minibuffer
  2. let me edit the minibuffer to include a regex
  3. do symbol overlay on my regex

@snowman snowman changed the title Request: Overlay regexp? Request: Add regexp support Nov 11, 2020
@snowman snowman reopened this Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants