Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7821943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:47:34+00:00 2026-06-02T07:47:34+00:00

Using jtags-mode (version 0.96) via ELPA in a development version of Emacs 24+, I

  • 0

Using jtags-mode (version 0.96) via ELPA in a development version of Emacs 24+, I cannot seem to enable the minor mode programmatically (manual invocation works fine). Before I drill into the gory details with what I have tried and the setup that I expect to work, the bottom line is that, after adding jtags-mode to the Java hook variable, I get the following complaint from Emacs when I first vist a Java source file:

Toggling jtags-mode off; better pass an explicit argument. [2 times]

After thoroughly reading the documentation on jtags-mode setup, I expected the following to suffice:

;; Support for Java coding. 
(autoload 'jtags-mode "jtags" "Toggle jtags mode." 1)

(defun java-setup ()
  (setq tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92)
    indent-tabs-mode nil
    tab-width 4
    fill-column 96
    c-comment-start-regexp "\\(@\\|/\\(/\\|[*][*]?\\)\\)"
    jtags-display-menu-flag t
    jtags-mode 1)
  (java-mode-indent-annotations-setup))

(add-hook 'java-mode-hook 'java-setup)
(add-hook 'java-mode-hook 'jtags-mode)
...

But this led to the complaint above. I have since tried to invoke jtags-mode directly in the java-setup() function, to no avail.

I would gladly take pointers on how to debug this issue if there is no obvious or easy solution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T07:47:36+00:00Added an answer on June 2, 2026 at 7:47 am

    Functions named xxx-mode are often toggle functions when called without arguments, i.e. they turn the mode on if it was off and vice versa. As you have added this function to a hook, this is how it is called. Several minor modes provide a function like turn-on-xxx-mode that are designed to be added to hook directly.

    When called with an argument, 1 typically activates them and -1 deactivates. Try calling it from your setup function rather than adding the jtags-mode function to the hook

    I would suggest activating the minor mode from your setup function. Also, in your setup code, you set the jtags-mode variable to 1, which normall is not the right thing to do. For example:

    (defun java-setup ()
      (setq tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92)
        indent-tabs-mode nil
        tab-width 4
        fill-column 96
        c-comment-start-regexp "\\(@\\|/\\(/\\|[*][*]?\\)\\)"
        jtags-display-menu-flag t)
      (jtags-mode 1)
      (java-mode-indent-annotations-setup))
    
    (add-hook 'java-mode-hook 'java-setup)
    

    Finally, a reservation. I haven’t used jtags-mode, this answer is based on general knowledge on how minor modes work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using C# for ASP.NET and MOSS development, we often have to embed JavaScript into
Using emacs on Ubuntu 11.10. I want to connect to a SQL Server database
Using online interfaces to a version control system is a nice way to have
I'm using JAGS and R, linked via rjags and R2jags, to fit a series
using Eclipse 3.4 Ganymede and I cannot find the way to add javadoc support
Using DMD 2.057, I cannot get the following code to compile: import std.stdio; import
Using LINQ on collections, what is the difference between the following lines of code?
using (var file_stream = File.Create(users.xml)) { var serializer = new XmlSerializer(typeof(PasswordManager)); serializer.Serialize(file_stream, this); file_stream.Close();
Using Nunit, I want to be able to write a test fixture that will
Using a restful resource in Rails, I would like to be able to insert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.