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

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

bug#14405: 24.3.50; read-regexp-defaults-function


From: Jambunathan K
Subject: bug#14405: 24.3.50; read-regexp-defaults-function
Date: Fri, 27 Dec 2013 10:52:31 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Juri Linkov <juri@jurta.org> writes:

>> I depend on occur and rgrep.  For occur, I want the symbol delimiters.
>> For rgrep, a mere tag at point will do.  If one were to use multi-occur
>> from Buffer menu mode, a symbol match doesn't make sense.
>
> You can use `this-command' for different defaults of different commands
> in a customized function like you wrote in the docstring that is
> still preserved in `read-regexp-defaults-function'.

For the benefit of googler out there.

    (setq read-regexp-defaults-function
          (lambda nil
            (pcase this-command
              (`rgrep (find-tag-default-as-regexp))
              (_ (find-tag-default-as-symbol-regexp)))))

It would be a good idea to choose a different name for
find-tag-default-*?  The function retrieves the tag-at-point but doesn't
find it (as in M-.).  So "find" is misleading.





reply via email to

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