unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Tiny change to find-tag-default.
@ 2006-07-21  9:53 Kim F. Storm
  2006-07-21 14:18 ` Drew Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Kim F. Storm @ 2006-07-21  9:53 UTC (permalink / raw)



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 <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-07-28 23:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-21  9:53 Tiny change to find-tag-default Kim F. Storm
2006-07-21 14:18 ` Drew Adams
2006-07-21 22:21   ` Kim F. Storm
2006-07-21 23:15     ` Drew Adams
2006-07-22  4:39 ` Richard Stallman
2006-07-22 12:17   ` martin rudalics
2006-07-23 17:34     ` Richard Stallman
2006-07-28 23:06       ` Kim F. Storm
2006-07-28  0:09     ` Kim F. Storm
2006-07-28  9:12       ` martin rudalics
2006-07-28 23:04 ` Kim F. Storm

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).