Hi Eric,
What do you think of the following enhancement to senator that P. Lord proposed?
As you first implemented senator hippie-expand extension I would like to read your opinion first before changing anything ;-)
Thanks in advance!
David
-------- Original Message --------
Subject: senator
Date: Mon, 17 Jun 2002 13:24:34 +0100
From: Phillip Lord <p.lord@...>
Reply-To: p.lord@...
To: David Ponce <david@...>
I have a suggestion for the senator package. In it you advice the
hippie-expand function like so....
(defadvice hippie-expand (before senator activate)
"Add senator completion to hippie expand try method.
This setting is local to Semantic enabled buffers."
(Or (not (semantic-active-p))
(memq #'senator-try-expand-semantic
hippie-expand-try-functions-list)
(set (make-local-variable 'hippie-expand-try-functions-list)
(cons #'senator-try-expand-semantic
(default-value 'hippie-expand-try-functions-list)))))
The problem is with this is that I have already set
hippie-expand-try-functions-list to a buffer local value for Java
mode (I like the try-complete-file-name functions lots, but they are a
pain in java mode). Because you use default-value the above
function over-writes the changes that I've tried to make in my
jde-mode-hook.
Why not something like...
(if (fboundp 'hippie-expand)
(add-hook 'senator-minor-mode
(lambda()
(make-local-variable 'hippie-expand-try-functions-list)
(if senator-minor-mode
(add-to-list 'hippie-expand-try-functions-list
'senator-try-expand-semantic)
(setq hippie-expand-try-functions-list
(delq 'senator-try-expand-semantic hippie-expand-try-functions-list))))))
Or maybe (eval-after-load "hippie-exp") instead of the (if (fboundp))
form, as hippie-expand is autoloaded.
Cheers
Phil
__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@...! http://shopnow.netscape.com/
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/