unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: ken <gebser@mousecar.com>
To: GNU Emacs List <help-gnu-emacs@gnu.org>
Subject: Re: string searching and saving results to a variable
Date: Fri, 18 Feb 2011 12:33:47 -0500	[thread overview]
Message-ID: <4D5EAD7B.3070403@mousecar.com> (raw)
In-Reply-To: <9889F717-9CDF-4E15-92AC-5E9D94C3E93D@gmail.com>


On 02/17/2011 08:30 AM Perry Smith wrote:
> On Feb 17, 2011, at 4:51 AM, ken wrote:
> 
>> On 02/15/2011 06:33 PM Perry Smith wrote:
>>> On Feb 15, 2011, at 5:15 PM, ken wrote:
>>>
>>>> ....
>>>>
>>>> <h3>Section 4</h3>
>>>>
>>>> but it could be multiple lines like this
>>>>
>>>> <h3 class="newest-chapter-section-type" align="center">On
>>>> the origins of elisp confusion</h3>
>>>>
>>>> It could even be three or four lines long.  Also, the line(s) could be
>>>> indented and so have unwanted white space in the first several columns.
>>>>
>>>> ....
>> Thanks, Perry.  That got me through that step.
>>
>> Next little thing: I want to check if the initial heading tag might
>> *already* contain the "name" attribute.  So with the point at the start
>> of that tag, I'd do something like this:
>>
>> (re-search-forward
>> "name=\"\\|name[whitespace]=\"\\|name[whitespace]=[whitespace]\""
>> end-heading nil nil)
>>
>> Is there a shortcut way in elisp to express any and all combinations of
>> whitespace...?  if not, how to do this?
> 
> The answer to your question appears to be `\s ' is for any whitespace
> character.  (backslash s space) But let me try to teach you how to fish.

Thanks again.


> 
> In emacs, do C-h i to get into "Info".  ....

I've known about "info" for a couple decades and use it (from within a
terminal window mostly) on occasion (and for more than just emacs), but
I've found over the years that it doesn't often give me the answer I
need.  In particular, it doesn't contain a lot of working examples...
these are much more helpful in learning and more prevalent on the web.
So I'm more likely to go to the web... which is what I did.  I guess in
this instance I should have gone to "info" first.

Let me make a disclaimer.  I'm figuring out as much of the coding as I
can on my own... and this before I come to this list.  It's only when I
search for an answer for a couple hours and get nowhere that I figure
it's time to ask the pros.  I mean isn't this a major reason for the
existence of this list?  The other thing is that I don't have a lot of
spare time for coding like this.  (I originally thought I might be able
to code this whole routine and start using it the same day.  Well, it's
been a good part of several days I've been on it now.  But I'm learning
a little more elisp, so that's okay... probably.)  And I try to post
questions which aren't going to require someone to either read or write
a lot.  And I'm not asking anyone to write the entire routine for me.
I'm kind of surprised that with all the people on this list, just one
person is providing any answers.  Maybe I'm on the wrong list (?).


> One reply to your question asked which mode you are in.  A good mode will
> understand the html far better than your searches.

I'm using html-helper-mode.  I've looked through a lot of the code (but,
yeah, not all of it) over the years and while the functions are pretty
basic in terms of functionality (more so than what I'm writing), the
code is not completely transparent.  I've tweaked a lot of it in trivial
ways, grepped it looking for stuff, but I'm not thinking it would be
terribly useful to read through the entirety of it.


> 
> HTH,
> Perry

Yeah, it did help.  Thanks again,
ken




  reply	other threads:[~2011-02-18 17:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 23:15 string searching and saving results to a variable ken
2011-02-15 23:33 ` Perry Smith
2011-02-16  6:55   ` ken
2011-02-16  9:21     ` Oleksandr Gavenko
2011-02-16 16:58       ` ken
2011-02-19 11:16         ` Oleksandr Gavenko
2011-02-16 11:28     ` Le Wang
2011-02-17 10:51   ` ken
2011-02-17 13:30     ` Perry Smith
2011-02-18 17:33       ` ken [this message]
2011-02-18 18:16         ` Le Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D5EAD7B.3070403@mousecar.com \
    --to=gebser@mousecar.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).