Hi Eric,
I submit you this patch (waiting on my disk drive for a long time ;-)
for semantic-util-modes.el to improve the way
`semantic-stickyfunc-mode' handles switching the `header-line-format'.
With that change, when `semantic-stickyfunc-mode' is turned on/off it
takes care of saving/restoring a previous header line. I appreciate
that when I use minor modes like `ruler-mode' or `tabbar-mode', which
also display things on the header line.
If you have not objection, I will check it in.
David
P.S.: I saw you fixed a lot of things in CEDET tools recently! Thanks!
2003-08-27 David Ponce <david@...>
* semantic-util-modes.el
(semantic-stickyfunc-old-hlf)
(semantic-stickyfunc-header-line-format): New variables.
(semantic-stickyfunc-mode-setup): When turning sticky func mode
on/off, take care of a header line previously there.
Index: semantic-util-modes.el
===================================================================
RCS file: /cvsroot/cedet/cedet/semantic/semantic-util-modes.el,v
retrieving revision 1.33
diff -c -r1.33 semantic-util-modes.el
*** semantic-util-modes.el 18 Jul 2003 05:23:21 -0000 1.33
--- semantic-util-modes.el 27 Aug 2003 19:03:08 -0000
***************
*** 1011,1016 ****
--- 1011,1025 ----
fringe so it does not appear that the code is moving left/right
when it lands in the sticky line.")
+ (defvar semantic-stickyfunc-old-hlf nil
+ "Value of the header line when entering sticky func mode.")
+ (make-variable-buffer-local 'semantic-stickyfunc-old-hlf)
+
+ (defconst semantic-stickyfunc-header-line-format
+ '(:eval (list semantic-stickyfunc-indent-string
+ (semantic-stickyfunc-fetch-stickyline)))
+ "The header line format used by sticky func mode.")
+
(defun semantic-stickyfunc-mode-setup ()
"Setup option `semantic-stickyfunc-mode'.
For semantic enabled buffers, make the function declaration for the top most
***************
*** 1018,1041 ****
text for that function in Emacs 21's header line."
(if semantic-stickyfunc-mode
(progn
! (if (not (and (featurep 'semantic) (semantic-active-p)))
! (progn
! ;; Disable minor mode if semantic stuff not available
! (setq semantic-stickyfunc-mode nil)
! (error "Buffer %s was not set up for parsing"
! (buffer-name))))
! (if (not (boundp 'default-header-line-format))
! (progn
! ;; Disable if there are no header lines to use.
! (setq semantic-stickyfunc-mode nil)
! (error "Sticky Function mode requires Emacs 21")))
;; Enable the mode
! (setq header-line-format
! (list semantic-stickyfunc-indent-string
! '(:eval (semantic-stickyfunc-fetch-stickyline))))
! )
;; Disable sticky func mode
! (setq header-line-format nil))
semantic-stickyfunc-mode)
;;;###autoload
--- 1027,1054 ----
text for that function in Emacs 21's header line."
(if semantic-stickyfunc-mode
(progn
! (unless (and (featurep 'semantic) (semantic-active-p))
! ;; Disable minor mode if semantic stuff not available
! (setq semantic-stickyfunc-mode nil)
! (error "Buffer %s was not set up for parsing" (buffer-name)))
! (unless (boundp 'default-header-line-format)
! ;; Disable if there are no header lines to use.
! (setq semantic-stickyfunc-mode nil)
! (error "Sticky Function mode requires Emacs 21"))
;; Enable the mode
! ;; Save previous buffer local value of header line format.
! (kill-local-variable 'semantic-stickyfunc-old-hlf)
! (when (local-variable-p 'header-line-format)
! (setq semantic-stickyfunc-old-hlf header-line-format))
! (setq header-line-format semantic-stickyfunc-header-line-format)
! )
;; Disable sticky func mode
! ;; Restore previous buffer local value of header line format if
! ;; the current one is the sticky func one.
! (when (eq header-line-format semantic-stickyfunc-header-line-format)
! (kill-local-variable 'header-line-format)
! (when (local-variable-p 'semantic-stickyfunc-old-hlf)
! (setq header-line-format semantic-stickyfunc-old-hlf))))
semantic-stickyfunc-mode)
;;;###autoload
|