2

When semantic-stickyfunc-mode is activated, the tabbar tabs are not visible.

I would like to write a function that show the tabs 2 seconds and then goes to semantic-stickyfunc-mode.

I tried with this:

     (defun timer-local-tabbar-show()
        (if (eq major-mode 'python-mode)
            (progn
              (tabbar-local-mode -1)
              (run-with-timer 2 nil (lambda () (tabbar-local-mode 1))))))
      (add-hook 'window-configuration-change-hook 'timer-local-tabbar-show)

The tabs are shown, and then disappear (good ;-), but semantic-stickyFunc-mode doesn't work (while semantic-stickyFunc-mode variable is 1)

Thank you for any help.

EDIT:

(defvar my-header-line-format nil)
  (defun timer-local-tabbar-show()
    (if (eq major-mode 'python-mode)
        (progn
          (setq my-header-line-format header-line-format)
          (tabbar-local-mode -1)
          (run-with-timer 1.5 nil
                          (lambda ()
                            (tabbar-local-mode 1)
                            (setq header-line-format my-header-line-format)
                            (redisplay)
                            )))))
  (add-hook 'window-configuration-change-hook 'timer-local-tabbar-show)

This version works better (thanks lawlist) but there are somme persistent random problems.

2
  • How about storing the value for header-line-format in a separate variable such as (defvar my-header-line-format nil) and then (setq my-header-line-format header-line-format) immediately before permitting tabbar-mode to take control, and then restore the value immediately after exiting tabbar-mode: (setq header-line-format my-header-line-format)? You may need to trigger a (redisplay) at the very end to get the screen to refresh.
    – lawlist
    Aug 1, 2016 at 18:39
  • Thanks for your help, I edit my question with your suggestions.
    – djangoliv
    Aug 2, 2016 at 6:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.