From: Jeffrey H. <jc...@ho...> - 2012-02-22 04:30:49
|
Bill Wohler <wo...@ne...> wrote: > Jeffrey Honig <jc...@ho...> wrote: > > > So, what I came up with is the requirement to pass a syntax table to > > mh-regexp-in-field-p and mh-modify-header-field. Specifying nil will > > cause mh-modify-header-field to make an assumption based on the field > > name. Does this sound like overkill? Maybe all we need is > > mh-modify-header-field to make a best guess? > > Remind me how syntax tables are used programmatically. What call > specifically is the one that needs it? Is it the re-search-forward call > in mh-regexp-in-field-p? Passing a syntax-table around as an argument > has a bad smell to me also. Can you just override a local variable with > let just before it is needed? Syntax tables are used by regexp call. So yes, we would need to wrap the re-search-forward call (and only that call). It is necessary to use (set-syntax-table) to change the table and (syntax-table) to get the current one. So the re-search-forward would need an (unwind-protect (save-excursion)) wrapper. > If the syntax table is only really needed in mh-regexp-in-field-p, the > lowest-level function, then perhaps we can put the syntax table smarts > in there. That way, we don't have to pass around a syntax table, nor do > we have to figure out what syntax table we need everywhere we call > mh-modify-header-field or mh-regexp-in-field-p. After sleeping on it, I think that is best. We can also provide a global variable that can be set with a let as a hint. Thanks! Jeff -- Jeffrey C. Honig <jc...@ho...> http://www.honig.net/jch GnuPG ID:14E29E13 <http://www.honig.net/jch/key.shtml> |