![]() |
|
|
|||||||
![]() |
VHDL - Custom indentation in Emacs Vhdl-mode |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Hello!
I hope some emacs guru can give me a tip on this My organization requires that the following indentation is used in this particular section of the code: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all; Can I customize vhdl-mode to beautify like that to me? The problem is that those 4 lines all return the same value in "Syntactic Info" ( = statement), so I have no clue if what I want is possible. Any ideas? Thanks, Hugo Hugo |
|
|
|
|
#2 |
|
Posts: n/a
|
Hugo wrote:
> Hello! > I hope some emacs guru can give me a tip on this > My organization requires that the following indentation is used in this > particular section of the code: > > library ieee; > use ieee.std_logic_1164.all; > use ieee.std_logic_unsigned.all; > use ieee.std_logic_arith.all; > > Can I customize vhdl-mode to beautify like that to me? yes > Any ideas? I see that you also posted this to gun.emacs.help. You will get an answer there. -- Mike Treseler Mike Treseler |
|
|
|
#3 |
|
Posts: n/a
|
"Mike Treseler" <> wrote in message
news:... > > I see that you also posted this to gun.emacs.help. > You will get an answer there. Surely mixing Emacs and firearms is a bad idea? Or did the editor wars just escalate while I wasn't looking? -Ben- Ben Jones |
|
|
|
#4 |
|
Posts: n/a
|
I think that must be forum for frustrated, suicidal emacs users...
Andy Ben Jones wrote: > "Mike Treseler" <> wrote in message > news:... > > > > I see that you also posted this to gun.emacs.help. > > You will get an answer there. > > Surely mixing Emacs and firearms is a bad idea? Or did the editor wars just > escalate while I wasn't looking? > > -Ben- Andy |
|
|
|
#5 |
|
Posts: n/a
|
Ben Jones wrote:
> "Mike Treseler" <> wrote in message > news:... >> I see that you also posted this to gun.emacs.help. >> You will get an answer there. > > Surely mixing Emacs and firearms is a bad idea? Maybe not. It passed the spell checker -- Mike Treseler "And I swear that I don't have a gnu." Mike Treseler |
|
|
|
#6 |
|
Posts: n/a
|
On 11 Jan 2007 07:01:27 -0800, "Hugo" <> wrote:
>Hello! >I hope some emacs guru can give me a tip on this >My organization requires that the following indentation is used in this >particular section of the code: > >library ieee; > use ieee.std_logic_1164.all; > use ieee.std_logic_unsigned.all; > use ieee.std_logic_arith.all; > >Can I customize vhdl-mode to beautify like that to me? This is the obvious place for a script to delete the last two lines and replace them with " use ieee.numeric_std;" - Brian Brian Drummond |
|
|
|
#7 |
|
Posts: n/a
|
Brian Drummond wrote:
> On 11 Jan 2007 07:01:27 -0800, "Hugo" <> wrote: > >> Hello! >> I hope some emacs guru can give me a tip on this >> My organization requires that the following indentation is used in this >> particular section of the code: >> >> library ieee; >> use ieee.std_logic_1164.all; >> use ieee.std_logic_unsigned.all; >> use ieee.std_logic_arith.all; >> >> Can I customize vhdl-mode to beautify like that to me? > > This is the obvious place for a script to delete the last two lines and > replace them with " use ieee.numeric_std;" That's a positive twist for the editor wars. While a macro to do a complete synopsys2numeric is intractable, one to simply start on the right foot by inserting library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; should not be difficult, and might make for more interesting questions here. I'll do such an emacs function and will collect and post any email contributions I get in the next week for your favorite editor. -- Mike Treseler Mike Treseler |
|
|
|
#8 |
|
Posts: n/a
|
"Mike Treseler" <> wrote in message news:... > While a macro to do a complete synopsys2numeric > is intractable, one to simply start on the > right foot by inserting > > library ieee; > use ieee.std_logic_1164.all; > use ieee.numeric_std.all; > > should not be difficult, and might > make for more interesting questions here. I know that when using CVS, and presumably other source code control systems, it is possible to create custom scripts that refuse a check-in if the file does not conform to certain rules. It would be good to have such a rule for VHDL that would barf when presented with ieee.std_logic_unsigned and friends. Cheers, -Ben- ....as for the editor wars, I am mostly in favour of gnu control. Although most people in this newsgroup would be quick to defend our right to bear ARMs... Ben Jones |
|
|
|
#9 |
|
Posts: n/a
|
So, any ideas on how to indent the use's relative to "library ieee" ? I
know it's pretty silly thing... The only way I know to accomplish that would be a post-beautifier function that fixes those lines.. but this sounds rather ugly... Tks, Hugo Mike Treseler escreveu: > Brian Drummond wrote: > > On 11 Jan 2007 07:01:27 -0800, "Hugo" <> wrote: > > > >> Hello! > >> I hope some emacs guru can give me a tip on this > >> My organization requires that the following indentation is used in this > >> particular section of the code: > >> > >> library ieee; > >> use ieee.std_logic_1164.all; > >> use ieee.std_logic_unsigned.all; > >> use ieee.std_logic_arith.all; > >> > >> Can I customize vhdl-mode to beautify like that to me? > > > > This is the obvious place for a script to delete the last two lines and > > replace them with " use ieee.numeric_std;" > > That's a positive twist for the editor wars. > While a macro to do a complete synopsys2numeric > is intractable, one to simply start on the > right foot by inserting > > library ieee; > use ieee.std_logic_1164.all; > use ieee.numeric_std.all; > > should not be difficult, and might > make for more interesting questions here. > > I'll do such an emacs function > and will collect and post > any email contributions I get > in the next week for your favorite editor. > > -- Mike Treseler Hugo |
|
|
|
#10 |
|
Posts: n/a
|
Hugo wrote:
> So, any ideas on how to indent the use's relative to "library ieee" ? I > know it's pretty silly thing... > > The only way I know to accomplish that would be a post-beautifier > function that fixes those lines.. but this sounds rather ugly... Since I hijacked your thread, here's an idea. Yes. If you look at the source for vhdl-beautify-buffer you will see that it is pretty tightly wound. I would write a wrapper function called vhdl-align-use that would call beautify then find the first USE, insert three spaces, etc. Something like: (defun align-use () "Indent vhdl use clauses" (vhdl-beautify-buffer) (beginning-of-buffer) ;;code to search for "use" lines and insert three spaces goes here. ) Mike Treseler |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to execute an external software from VHDL? And how to interface VHDL with JAVA? | becool_nikks | Software | 0 | 03-06-2009 07:08 PM |
| Help on auto conversion from Matlab to vhdl on filter design | hardheart | Hardware | 0 | 12-07-2007 09:19 AM |
| flexible recording mode | SS | DVD Video | 1 | 06-28-2005 11:15 PM |
| Safe Mode doesn't work, Normal mode does | bobG | A+ Certification | 15 | 07-16-2004 01:50 PM |
| Safe Mode doesn't work, Normal mode does | bobG | A+ Certification | 0 | 07-06-2004 11:57 PM |