> But that was just a typo. Please update, I removed it.
> I do not see what the typo you are talking about is. Where is the > error in this code snipet ?
the code snippet does not have a typo, it's tassilo's reply to my question how to get defparameter in elisp. the typo is the fact that there was a defparamater in his code.
-- Joost Kremers joostkrem...@yahoo.com Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9)
> yes, i saw that function. however, the thing is, the text itself is > simply too large to fit on my screen. ;-) telling doc-view to create > smaller images wouldn't work either, because then the text becomes too > small to read.
But you should be able to scroll with C-v/M-v or the arrow keys, aren't you?
>>> other viewers (xdvi, xpdf) usually use the space bar to scroll down >>> and jump to the top of the next page if the bottom of the page is >>> shown. usually, DEL or backspace does the opposite.
>> Implemented.
> thanks, i just downloaded the new version. your way of doing it is a > bit smarter than mine. ;-) unfortunately, moving backward from the top > of page X to the bottom of page X-1 doesn't work. the cause seems to > be to be what i would consider a bug in emacs, though.
> the problem is that calling (goto-char (point-max)) makes the entire > image disappear from the visible part of the buffer; only the line > "Page x of y" is visible. if at this point i hit DEL to scroll down > the image and make it visible, emacs displays the *top* part of the > image, not the bottom part, which i would expect.
Yes, I know. Emacs' image scrolling capabilities are somewhat poor.
> btw, defparameter is back again, and you've made a typo: > doc-view-scroll-dows-or-previous-page (twice) > ...................^
Thanks, I've fixed both.
Bye, Tassilo -- Chuck Norris CAN believe it's not butter.
> I can see that Tassilo might want to keep his bindings as he also > has the characters "n" and "p" bound to the "next/previous PDF > page" functions; however, I think that (if he keeps the existing > bindings) the "M-p" binding should be changed to "C-p".
> I agree with that statement.
Me, too. And I changed the binding to C-p some days ago. :-)
Bye, Tassilo -- Chuck Norris is not Irish. His hair is soaked in the blood of his victims.
Tassilo Horn <tass...@member.fsf.org> writes: > I think I have to create a function that changes to defparameter, > evaluates the sexp and changes back to defvar...
Done!
--8<---------------cut here---------------start------------->8--- (defun th-eval-last-defvar-as-defparameter (ARG) "Eval the `defvar' before point as if it was a `defparameter'." (interactive "P") (save-excursion (let ((sexp (buffer-substring-no-properties (point) (progn (backward-sexp) (point))))) (with-temp-buffer (insert sexp) (goto-char (point-min)) (condition-case nil (progn (search-forward "(defvar ") (replace-match "(defparameter ") (goto-char (point-max)) (eval-last-sexp ARG)) (error (message "The sexp before point must be a defvar form!"))))))) --8<---------------cut here---------------end--------------->8---
Now it's bound to `C-x C-v'. Hopefully this was my last defparameter checkin.
Bye, Tassilo -- People say that if you play Microsoft CD's backwards, you hear satanic things, but that's nothing, because if you play them forwards, they install Windows.
Hey, it's a whole bunch of fun. I've just finished implementing a new feature: Now you can REGEXP-SEARCH in documents. Please git-pull and give it a try. The commentary explains how to use it.
I tested it a bit and it seems to work for me, but certainly I added some new bugs, too.
Bye, Tassilo -- My software never has bugs. It just develops random features.
Tassilo Horn <tass...@member.fsf.org> writes: > I think I have to create a function that changes to > defparameter, evaluates the sexp and changes back to defvar...
Tassilo Horn <tass...@member.fsf.org> writes: > Hey, it's a whole bunch of fun. I've just finished implementing a new > feature: Now you can REGEXP-SEARCH in documents. Please git-pull and > give it a try. The commentary explains how to use it.
Hey, what a coincidence - I was just about to write a note saying something along the lines of "now that the speed issue has been addressed, the biggest remaining shortfall is..." and you went and addressed it before I finished writing the post! ;-)
It would be nice if there was some way of highlighting the matching terms in the document; however, I can't see how you would be able to do that. Alternatively, as each matching page is displayed with "C-S-n", perhaps you could display at the bottom of the page the matches on that page with a certain amount of context - (e.g. - 10 words on either side of each match). That would let the reader find the matches more easily on that page.
Hey, it's a whole bunch of fun. I've just finished implementing a new feature: Now you can REGEXP-SEARCH in documents. Please git-pull and give it a try. The commentary explains how to use it.
the code snippet does not have a typo, it's tassilo's reply to my question how to get defparameter in elisp. the typo is the fact that there was a defparamater in his code.
> Tassilo Horn <tass...@member.fsf.org> writes: >> Hey, it's a whole bunch of fun. I've just finished implementing a >> new feature: Now you can REGEXP-SEARCH in documents. Please git-pull >> and give it a try. The commentary explains how to use it.
> Hey, what a coincidence - I was just about to write a note saying > something along the lines of "now that the speed issue has been > addressed, the biggest remaining shortfall is..." and you went and > addressed it before I finished writing the post! ;-)
Something in my head whispered: "Bill wants to search documents... search documents... uooouuuhhh!"
> It would be nice if there was some way of highlighting the matching > terms in the document;
Haha, this one was nice! :-)
> however, I can't see how you would be able to do that. Alternatively, > as each matching page is displayed with "C-S-n", perhaps you could > display at the bottom of the page the matches on that page with a > certain amount of context - (e.g. - 10 words on either side of each > match).
I'll address this later today.
> That would let the reader find the matches more easily on that page.
Yes, when I tested the searching functionality I always thought: "Why's that page a match, I cannot find that damn "foo" anywhere!" (Till some minutes later I found that little "football" somewhere.)
Bye, Tassilo -- Chuck Norris ordered a Big Mac at Burger King, and got one.
Hey, it's very nice. I'm grabbing the video right now. I'm very curious how doc-view looks in action. :-P
Bye, Tassilo -- Fighting patents one by one will never eliminate the danger of software patents, any more than swatting mosquitoes will eliminate malaria. (Richard M. Stallman)
> Hey, it's a whole bunch of fun. I've just finished implementing a new > feature: Now you can REGEXP-SEARCH in documents. Please git-pull and > give it a try. The commentary explains how to use it.
it works fine, i haven't found any real bugs (yet ;-).
one thing though: the first time you press C-s, the document gets converted to txt, but once this is done, you're not asked for a search string and no searching is done. you have to press C-s again to do this. is this intentional? if so, i must admit it's not very intuitive.
and another thing: would it be possible to inform the user about the dimensions of the image when slicing with `s s'?
TIA
joost
-- Joost Kremers joostkrem...@yahoo.com Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9)
> Alternatively, as each matching page is displayed with "C-S-n", > perhaps you could display at the bottom of the page the matches on > that page with a certain amount of context - (e.g. - 10 words on > either side of each match).
Now I display the line containing the match at the bottom. It's possible that you have to delete the TXT files from the cache, because this required a new option to pdftotext, so that the lines in the PDF match the lines in the TXT file.
Bye, Tassilo -- Chuck Norris is responsible for China's over-population. He hosted a Karate tournament in Beijing and all women within 1,000 miles became pregnant instantly.
>> Hey, it's a whole bunch of fun. I've just finished implementing a >> new feature: Now you can REGEXP-SEARCH in documents. Please git-pull >> and give it a try. The commentary explains how to use it.
> it works fine, i haven't found any real bugs (yet ;-).
Because I don't make any faults. :-)
> one thing though: the first time you press C-s, the document gets > converted to txt, but once this is done, you're not asked for a search > string and no searching is done. you have to press C-s again to do > this. is this intentional?
Yes, because the process may take several seconds on slow machines and big documents.
> if so, i must admit it's not very intuitive.
Yeah, now it's don this way: If the process finishes and the user didn't switch to another buffer, the user will be queried for a regexp. If he switched away, he won't be bothered.
> and another thing: would it be possible to inform the user about the > dimensions of the image when slicing with `s s'?
Yes, now it always displays the valid range.
Bye, Tassilo -- GNU Emacs is a text editor for Über-Geeks.
>>> Hey, it's a whole bunch of fun. I've just finished implementing a >>> new feature: Now you can REGEXP-SEARCH in documents. Please git-pull >>> and give it a try. The commentary explains how to use it.
>> it works fine, i haven't found any real bugs (yet ;-).
> Because I don't make any faults. :-)
heh, i wish i could say the same about me. ;-)
> Yeah, now it's don this way: If the process finishes and the user didn't > switch to another buffer,
ah, i hadn't though of that possibility... true of course, that must be taken into account.
> the user will be queried for a regexp. If he > switched away, he won't be bothered.
sounds perfect.
>> and another thing: would it be possible to inform the user about the >> dimensions of the image when slicing with `s s'?
> Yes, now it always displays the valid range.
great!
-- Joost Kremers joostkrem...@yahoo.com Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9)
Tassilo Horn <tass...@member.fsf.org> writes: > Bill Clementson <billc...@gmail.com> writes: >> Alternatively, as each matching page is displayed with "C-S-n", >> perhaps you could display at the bottom of the page the matches on >> that page with a certain amount of context - (e.g. - 10 words on >> either side of each match).
> Now I display the line containing the match at the bottom. It's > possible that you have to delete the TXT files from the cache, because > this required a new option to pdftotext, so that the lines in the PDF > match the lines in the TXT file.
Great - that looks really nice.
I tried some searches on a number of different files and they almost all worked fine. However, when I tried searching Peter Seibel's Practical Common Lisp PDF book (free download from Apress: http://www.apress.com/free/index.html), there were mismatches between the page that was displayed and the matching text. The page number corresponded to the page number that was displayed; however, the search term wasn't on the page. The line containing the match was displayed correctly; however, it was for a page later in the document. This seemed to happen for any searches I did of the PCL pdf file.
First, I thought it might have something to do with the size of the pdf file or blank pages not being counted; however, searches of the sicp.pdf book all seemed to produce correct results, so I'm not sure why the search functionality doesn't work properly in some instances.
Tassilo Horn <tass...@member.fsf.org> writes: > Bill Clementson <billc...@gmail.com> writes: >> Tassilo Horn <tass...@member.fsf.org> writes: >>> Hey, it's a whole bunch of fun. I've just finished implementing a >>> new feature: Now you can REGEXP-SEARCH in documents. Please git-pull >>> and give it a try. The commentary explains how to use it.
>> Hey, what a coincidence - I was just about to write a note saying >> something along the lines of "now that the speed issue has been >> addressed, the biggest remaining shortfall is..." and you went and >> addressed it before I finished writing the post! ;-)
> Something in my head whispered: "Bill wants to search documents... > search documents... uooouuuhhh!"
Good to hear that my telepathic, DWIW utility is working properly. It also is slated to appear in CVS Emacs shortly. ;-)
>> It would be nice if there was some way of highlighting the matching >> terms in the document;
> Haha, this one was nice! :-)
I thought you would find that amusing. ;-)
>> however, I can't see how you would be able to do that. Alternatively, >> as each matching page is displayed with "C-S-n", perhaps you could >> display at the bottom of the page the matches on that page with a >> certain amount of context - (e.g. - 10 words on either side of each >> match).
> I'll address this later today.
Great - I see you've already done it and I have a few comments in a separate reply.
>> That would let the reader find the matches more easily on that page.
> Yes, when I tested the searching functionality I always thought: "Why's > that page a match, I cannot find that damn "foo" anywhere!" (Till some > minutes later I found that little "football" somewhere.)
I have the same problem - if I don't have the phrase pointed out to me, I can spend ages trying to find it on the page.
> one more thing: i added (require 'cl) to the source to keep the > compiler from complaining about remove-if.
Oh, indeed. I added it.
Bye, Tassilo -- People sometimes ask me if it is a sin in the Church of Emacs to use vi. Using a free version of vi is not a sin; it is a penance. So happy hacking. (Richard M. Stallman)
>> Now I display the line containing the match at the bottom. It's >> possible that you have to delete the TXT files from the cache, >> because this required a new option to pdftotext, so that the lines in >> the PDF match the lines in the TXT file.
> Great - that looks really nice.
Yippie!
And it's even getting better: the search matches are now displayed in the help-echo, too.
> I tried some searches on a number of different files and they almost > all worked fine. However, when I tried searching Peter Seibel's > Practical Common Lisp PDF book (free download from Apress: > http://www.apress.com/free/index.html), there were mismatches between > the page that was displayed and the matching text. The page number > corresponded to the page number that was displayed; however, the > search term wasn't on the page. The line containing the match was > displayed correctly; however, it was for a page later in the > document. This seemed to happen for any searches I did of the PCL pdf > file.
I have that PDF and it works for me. Could you please delete the doc.txt in the cache and try again?
If it still doesn't work, please post your search regexp.
Bye, Tassilo -- When in a bar, you can order a drink called a "Chuck Norris". It is also known as a "Bloody Mary", if your name happens to be Mary.