unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Custom indentation in Emacs Vhdl-mode
@ 2007-01-11 15:01 haws
  0 siblings, 0 replies; 4+ messages in thread
From: haws @ 2007-01-11 15:01 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Custom indentation in Emacs Vhdl-mode
       [not found]     ` <1168621500.477449.295080@l53g2000cwa.googlegroups.com>
@ 2007-01-12 17:51       ` Mike Treseler
  2007-01-12 17:58         ` haws
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Treseler @ 2007-01-12 17:51 UTC (permalink / raw)


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.
)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Custom indentation in Emacs Vhdl-mode
  2007-01-12 17:51       ` Custom indentation in Emacs Vhdl-mode Mike Treseler
@ 2007-01-12 17:58         ` haws
  0 siblings, 0 replies; 4+ messages in thread
From: haws @ 2007-01-12 17:58 UTC (permalink / raw)


Ok, thanks! I guess that solution will do!

I thought I'd have to change the syntactic meaning of "use", but
vhdl-mode is kinda complicated (20k lines), so I probably don't want to
mess there anyway :)

Mike Treseler escreveu:

> 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.
> )

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Custom indentation in Emacs Vhdl-mode
       [not found]         ` <1169822919.212235.9970@m58g2000cwm.googlegroups.com>
@ 2007-01-26 17:54           ` Mike Treseler
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Treseler @ 2007-01-26 17:54 UTC (permalink / raw)
  To: help-gnu-emacs

HS wrote:
> My approach is a little different... I have a vhdl file template that is
> inserted when I run "Insert header", and it already contains ieee
> clauses, entity and architecture pairs, etc.

>>> Mike Treseler wrote:
>>> (defun vhdl-ieee () "Insert ieee use clauses"
>>>  (interactive)
>>>  (insert "
>>> library ieee;
>>> use ieee.std_logic_1164.all;
>>> use ieee.numeric_std.all;
>>> "))

> On 26 jan, 11:17, Martin Thompson  wrote:
>> And add this:
>> (define-key vhdl-template-map "\C-pi" 'vhdl-ieee)
>> to add it to the VHDL-template keymappings, (so you do C-c C-t C-p i
>> to insert it).  Now I need to figure out how to get it onto the
>> menu...


Thanks to HS and Martin for the vhdl-mode tips.
Looks like emacs wins round one 3 to nil :)

          -- Mike Treseler

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-01-26 17:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1168527687.560869.42360@k58g2000hse.googlegroups.com>
     [not found] ` <3k2fq2l3lgvcfe7t45o1binaef0872p5ok@4ax.com>
     [not found]   ` <50polbF1grf3jU1@mid.individual.net>
     [not found]     ` <1168621500.477449.295080@l53g2000cwa.googlegroups.com>
2007-01-12 17:51       ` Custom indentation in Emacs Vhdl-mode Mike Treseler
2007-01-12 17:58         ` haws
     [not found]     ` <51sfeuF1m0akrU1@mid.individual.net>
     [not found]       ` <uhcud3mad.fsf@trw.com>
     [not found]         ` <1169822919.212235.9970@m58g2000cwm.googlegroups.com>
2007-01-26 17:54           ` Mike Treseler
2007-01-11 15:01 haws

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).