From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Tiny change to find-tag-default. Date: Fri, 21 Jul 2006 11:53:23 +0200 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1153475732 11168 80.91.229.2 (21 Jul 2006 09:55:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Jul 2006 09:55:32 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 21 11:55:25 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G3rj5-0002Wa-HZ for ged-emacs-devel@m.gmane.org; Fri, 21 Jul 2006 11:55:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G3rj5-0006Xp-47 for ged-emacs-devel@m.gmane.org; Fri, 21 Jul 2006 05:55:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G3rit-0006XO-WB for emacs-devel@gnu.org; Fri, 21 Jul 2006 05:55:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G3rit-0006XA-57 for emacs-devel@gnu.org; Fri, 21 Jul 2006 05:55:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G3rit-0006X7-04 for emacs-devel@gnu.org; Fri, 21 Jul 2006 05:55:07 -0400 Original-Received: from [195.41.46.235] (helo=pfepa.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G3rjG-0004Iz-Gt for emacs-devel@gnu.org; Fri, 21 Jul 2006 05:55:30 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (unknown [80.165.4.124]) by pfepa.post.tele.dk (Postfix) with SMTP id 09088FAC041 for ; Fri, 21 Jul 2006 11:55:04 +0200 (CEST) Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:57424 Archived-At: The following way of working seems natural to me -- but doesn't work. [I have transient-mark-mode == t] Suppose I'm looking at a text, and want to grep for a phrase (e.g. just two words) in that text, I highlight the text to search for (set mark, go to end of text) and do M-x lgrep. However, this ignores my selection, and just suggests the word at point at the regexp. The following patch changes that to DTRT (IMO): I don't think it makes sense to do this w/o transient-mark-mode, but that's why we have temporary transient-mark-mode marking. Index: subr.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/subr.el,v retrieving revision 1.521 diff -b -c -r1.521 subr.el *** subr.el 18 Jul 2006 01:34:48 -0000 1.521 --- subr.el 21 Jul 2006 09:47:53 -0000 *************** *** 1993,1998 **** --- 1993,2001 ---- (defun find-tag-default () "Determine default tag to search for, based on text at point. If there is no plausible default, return nil." + (if (and transient-mark-mode + mark-active) + (buffer-substring-no-properties (point) (mark)) (save-excursion (while (looking-at "\\sw\\|\\s_") (forward-char 1)) *************** *** 2012,2018 **** (forward-char 1)) (point))) (error nil))) ! nil))) (defun play-sound (sound) "SOUND is a list of the form `(sound KEYWORD VALUE...)'. --- 2015,2021 ---- (forward-char 1)) (point))) (error nil))) ! nil)))) (defun play-sound (sound) "SOUND is a list of the form `(sound KEYWORD VALUE...)'. -- Kim F. Storm http://www.cua.dk