all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* grep-find: first ':" char is a zero
@ 2019-11-25 14:49 jonetsu
  2019-11-25 15:09 ` Noam Postavsky
  0 siblings, 1 reply; 4+ messages in thread
From: jonetsu @ 2019-11-25 14:49 UTC (permalink / raw)
  To: help-gnu-emacs

The first character ':' after the filename in grep-find turns out to be
a zero.  The second is a legitimate ':'.  Both are shown as ':'.  This
means that the line numbers for each find are in between a zero and a
':' even though they look like being between two ':'.

I found this when searching (C-s) for a ':' from the beginning of a
line.  It would not stop at the first ':'

Is there a way to configure the grep-find results so that an actual
character is used instead of zero ?




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

* Re: grep-find: first ':" char is a zero
  2019-11-25 14:49 grep-find: first ':" char is a zero jonetsu
@ 2019-11-25 15:09 ` Noam Postavsky
  2019-11-25 15:14   ` jonetsu
  0 siblings, 1 reply; 4+ messages in thread
From: Noam Postavsky @ 2019-11-25 15:09 UTC (permalink / raw)
  To: jonetsu; +Cc: Help Gnu Emacs mailing list

On Mon, 25 Nov 2019 at 09:49, jonetsu <jonetsu@teksavvy.com> wrote:

> Is there a way to configure the grep-find results so that an actual
> character is used instead of zero ?

Yes, customize grep-use-null-filename-separator to nil.



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

* Re: grep-find: first ':" char is a zero
  2019-11-25 15:09 ` Noam Postavsky
@ 2019-11-25 15:14   ` jonetsu
  2019-11-26 19:36     ` Nick Dokos
  0 siblings, 1 reply; 4+ messages in thread
From: jonetsu @ 2019-11-25 15:14 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

On Mon, 25 Nov 2019 10:09:29 -0500
Noam Postavsky <npostavs@gmail.com> wrote:

> On Mon, 25 Nov 2019 at 09:49, jonetsu <jonetsu@teksavvy.com> wrote:
> 
>  [...]  
> 
> Yes, customize grep-use-null-filename-separator to nil.

Thanks, this will be quite helpful.  

In the meanwhile I found that by using hexl-mode on a saved version of
the grep-find results and subsequently exiting hexl-mode, the 0
character will be shown as caret + @.  It then becomes easy to do a
regular search-replace.

Having grep-find not using a 0 character is the most direct solution.





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

* Re: grep-find: first ':" char is a zero
  2019-11-25 15:14   ` jonetsu
@ 2019-11-26 19:36     ` Nick Dokos
  0 siblings, 0 replies; 4+ messages in thread
From: Nick Dokos @ 2019-11-26 19:36 UTC (permalink / raw)
  To: help-gnu-emacs

jonetsu <jonetsu@teksavvy.com> writes:

> On Mon, 25 Nov 2019 10:09:29 -0500
> Noam Postavsky <npostavs@gmail.com> wrote:
>
>> On Mon, 25 Nov 2019 at 09:49, jonetsu <jonetsu@teksavvy.com> wrote:
>> 
>>  [...]  
>> 
>> Yes, customize grep-use-null-filename-separator to nil.
>
> Thanks, this will be quite helpful.  
>
> In the meanwhile I found that by using hexl-mode on a saved version of
> the grep-find results and subsequently exiting hexl-mode, the 0
> character will be shown as caret + @.  It then becomes easy to do a
> regular search-replace.
>
> Having grep-find not using a 0 character is the most direct solution.
>

... but it might lead to problems with filenames containing white
space or other strange chars. Now that you know it is a NUL, you can
use `C-s C-q C-<space>' to search for it if you want to keep the --null
option on grep.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




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

end of thread, other threads:[~2019-11-26 19:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-25 14:49 grep-find: first ':" char is a zero jonetsu
2019-11-25 15:09 ` Noam Postavsky
2019-11-25 15:14   ` jonetsu
2019-11-26 19:36     ` Nick Dokos

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.