Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 10-22-2020, 02:23 AM   #1
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Buglet? Warning Message needed?

Hi

I have been using Search and Replace and the Saved Searches and switching between them in the Calibre Editor a lot recently.

I have noticed that when I appear to have have the sane regex in both and use the count facility on Search and Replace and the Saved Searches I sometimes get different counts.

I investigated the issue and found this

1. Highlight text <br class="calibre8"/>
2. Paste into Saved Searches Editor
3. Click on Count button
4. Get a count of X

5.Highlight text <br class="calibre8"/>
6.Click on Magnifying Glass Button
7. It puts the text
8. Use the Count Menu Option
9. Get a count of Y

I think I have spotted why this happens. When the Magnifying Glass Button is used to populate Search and Replace it escapes the outer chevrons i.e. \*<br class="calibre8"/>.

When text is pasted into Saved Searches it does not automatically escape the outer chevrons i.e. <br class="calibre8"/>.

I do not know what if anything should be done about the above but I have a suggestion which might help. Please see my next posting.
Thasaidon is offline   Reply With Quote
Old 10-22-2020, 02:56 AM   #2
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Second Post - Suggestion

Hi Kovid

A suggestion to consider, even if only for a second. before you say "patches welcome"

As I said in my previous post

Quote:
I have been using Search and Replace and the Saved Searches and switching between them in the Calibre Editor a lot recently.
and I noticed something .

Essentially Search and Replace and Edit Search page of Saved Searches are duplicates.

The only differences I can see is that you can populate Search and Replace by clicking on the Magnifying Glass button and it does not have a Count Button.

My suggestion is to consider

1.removing the current Search and Replace screen and replace it with the B]Edit Search[/B] page of Saved Searches
2.When the current Search and Replace function is requested use the B]Edit Search[/B] page of Saved Searches .
3 This could perhaps be prepopulated if the Magnifying Glass button had been pressed.

This would free up some screenspace.
It eliminates possible mismatches in counts between Search and Replace and Saved Searches.
The Saved Searches Edit screen has much bigger boxes to put the regex in. This would mean most regexes would be displayed in full rather than disappearing out of the box.

I do have a workaround which helps but is not ideal. Instead of using Search and Replace I have set up a Dummy saved search which I have put at the top of the list. I then open and use this rather than Search and Replace unless it is a small very minor Search and Replace.

Hope what I have put is clear.
Attached Thumbnails
Click image for larger version

Name:	findsave.jpg
Views:	163
Size:	16.9 KB
ID:	182926   Click image for larger version

Name:	Savesearch.jpg
Views:	157
Size:	32.7 KB
ID:	182927  
Thasaidon is offline   Reply With Quote
Advert
Old 10-22-2020, 10:01 PM   #3
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Thasaidon View Post
Hi

I have been using Search and Replace and the Saved Searches and switching between them in the Calibre Editor a lot recently.

I have noticed that when I appear to have have the sane regex in both and use the count facility on Search and Replace and the Saved Searches I sometimes get different counts.

I investigated the issue and found this

1. Highlight text <br class="calibre8"/>
2. Paste into Saved Searches Editor
3. Click on Count button
4. Get a count of X

5.Highlight text <br class="calibre8"/>
6.Click on Magnifying Glass Button
7. It puts the text
8. Use the Count Menu Option
9. Get a count of Y
As a quick test, I copied the same thing to from the text area into both the search and saved search and the counts came back the same.
Quote:
I think I have spotted why this happens. When the Magnifying Glass Button is used to populate Search and Replace it escapes the outer chevrons i.e. \*<br class="calibre8"/>.

When text is pasted into Saved Searches it does not automatically escape the outer chevrons i.e. <br class="calibre8"/>.
These are two different actions. Clicking the magnifying glass button is saying "copy the selected text to the search and escape it appropriately for the current search mode". Whereas cut-and-paste doesn't do this, but it works the same for either type of search. To me, you aren't comparing the same thing in your search.

For your other suggestion, I don't like it. I swap between the search-and-replace and saved searches all the time. And have the edit opened whiles searching enough to not want that. When I am editing a saved search, I frequently run another search looking for why the saved search didn't do what I wanted. Or looking to make sure it did cover all cases.

What would be good would be a way to create a saved search from the current search. That would save some copy-paste actions. Or to copy a saved search to the current search. I frequently edit saved searches and tweak them a bit for the current book but don't want to save the changes. And I have a couple of saved searches that are more templates than actual searches. I expect to change these each time I use them.
davidfor is offline   Reply With Quote
Old 10-23-2020, 12:15 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,355
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
As davidfor said, the magnifying glass does escaping in addition, not the same as copy/paste.

The find panel is deliberately made the way it is, it is meant for quick, relatively simply searches, unlike the saved search panel.

@davidfor: you can right click the find box in the search panel and create a saved search from it.
kovidgoyal is offline   Reply With Quote
Old 10-23-2020, 12:54 AM   #5
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Thank you for your answers and info.

With what you have told me I can get these features to nore or less work how i wish.

The point you have not picked up on is why Search and Replace can give a different Count to that produced by Saved Clips.

Design query - if an unescaped "cut and paste" query and a similar escaped query by using the Magnifying Glass button in, Search and Replace why bother showing the escape characters?
Thasaidon is offline   Reply With Quote
Advert
Old 10-23-2020, 01:29 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,355
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Because they are searching for different things.
kovidgoyal is offline   Reply With Quote
Old 10-23-2020, 07:52 AM   #7
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Thasaidon View Post
The point you have not picked up on is why Search and Replace can give a different Count to that produced by Saved Clips.

Design query - if an unescaped "cut and paste" query and a similar escaped query by using the Magnifying Glass button in, Search and Replace why bother showing the escape characters?
No, I think I answered that. It's possible that the problem is you haven't shown the exact searches you are doing. Your description was to highlight:

Code:
<br class="calibre8"/>
And you copied and pasted it, and use the magnifying glass to start a search for it. When I do that, I get the same search.

You also state that the magnifying glass escapes the "escapes the outer chevrons" and gave the example:

Code:
\*<br class="calibre8"/>
The only escaped character is for an asterisk before the first chevron. That is a different search looking for an asterisk before the tag. And when I paste the what you first said into an editor and repeat those steps, the characters are not escaped. But, I also don't get the asterisk. If I add that and select it before starting the search, the asterisk is escaped.

I can't reproduce your report. But, there are also inconsistencies in the report. I don't know if there are typos above, or something in how we are both doing the testing.
davidfor is offline   Reply With Quote
Old 10-23-2020, 07:53 AM   #8
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by kovidgoyal View Post
@davidfor: you can right click the find box in the search panel and create a saved search from it.
How have I never noticed that?
davidfor is offline   Reply With Quote
Old 10-23-2020, 09:32 AM   #9
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
My apologies to both of you.

You are right I probably got a little confused in using the search and replace and saved search features.

I have only just started regularly using both of them together. Before that I rarely used them.

Having checked the manual I see I have been making an elementary mistake because I had assumed I had sufficient knowledge of Regex not to need it.

Ah well back to square one again.
Thasaidon is offline   Reply With Quote
Old 10-23-2020, 11:05 AM   #10
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,062
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
you guys are working too hard (cut&paste)
highlight text to be found: Ctrl-F
theducks is offline   Reply With Quote
Old 10-24-2020, 01:16 AM   #11
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Thasaidon View Post
My apologies to both of you.

You are right I probably got a little confused in using the search and replace and saved search features.

I have only just started regularly using both of them together. Before that I rarely used them.

Having checked the manual I see I have been making an elementary mistake because I had assumed I had sufficient knowledge of Regex not to need it.
There's the mistake: no-one has sufficient knowledge of regex
davidfor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Buglet? Thasaidon Sigil 10 10-07-2020 10:38 AM
can't find the warning message for vendor-extension JLius ePub 4 04-02-2014 04:59 AM


All times are GMT -4. The time now is 04:00 PM.


MobileRead.com is a privately owned, operated and funded community.