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 8341459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:29:12+00:00 2026-06-09T05:29:12+00:00

I have been using Emacs to create and modify Verilog codes for some time

  • 0

I have been using Emacs to create and modify Verilog codes for some time now.
However, in Verilog mode, I am facing a small issue when I try to insert an “if” statement using the emacs command:

C-c C-t ?

The following is an example of how the statement is created in the above scenario:

if (a<b) begin
// the rest of the code

However I need emacs to insert the “begin” in the next line as shown below:

if (a<b)
begin
//rest of the code

After digging through the Verilog customization options available, I found one option named Verilog Indent Begin After If which I think is supposed to produce the above effect. However toggling this option did not give my any visible changes.

Any help would be greatly appreciated.

  • 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-09T05:29:14+00:00Added an answer on June 9, 2026 at 5:29 am

    Looking at the code you will see that the function:

    (define-skeleton verilog-sk-if
      "Insert a skeleton if statement."
      > "if (" '(verilog-sk-prompt-condition) & ")" " begin" \n
      > _ \n
      > (- verilog-indent-level-behavioral) "end " \n )
    

    actually defines a skeleton. Just copy paste and add another line-break:

    (define-skeleton my-verilog-sk-if
      "Insert a skeleton if statement."
      > "if (" '(verilog-sk-prompt-condition) & ")" \n " begin" \n
      > _ \n
      > (- verilog-indent-level-behavioral) "end " \n )
    

    now we just need to hook our function over the old one in verilog-mode:

    (add-hook 'verilog-mode-hook
              '(lambda ()
                 ;; this is quite the hack because we don't respect
                 ;; the usual prefix of verilog-mode but sufficient for us
                 (define-key verilog-mode-map "\C-c\C-t?"
                             'my-verilog-sk-if)))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using emacs for some time now and am slowly getting the
Hi I have been using Emacs23 for some time now and find it a
I have been using TortoiseSVN for some time and I really like it. I
I have been using some Javascript to create a text field once an certain
I have been using nxml-mode to edit XHTML. However, it does not work very
I have been using mySQL Quite a bit however, this is the first time
I have been using Emacs for more than three years now but it still
I've been using Emacs for quite some time for basic text editing but as
I have been using maven for some time and I am quite fond of
I have been using emacs for a while but not so familiar with lisp

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.