unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* lisp execution stops after dired
@ 2011-07-18 11:18 David Belohrad
  2011-07-19 20:34 ` Valentin Plechinger
  0 siblings, 1 reply; 2+ messages in thread
From: David Belohrad @ 2011-07-18 11:18 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1237 bytes --]

Dear All.

have this:

(defun vhdl-rename-signal (searchDir)
  "renames signal starting from searchDir"
  (interactive "DEnter top-level directory to search: ")
  ;; first do dired
  (find-dired searchDir "-name \*.vhd -or -name \*.qsf")
  (dired-toggle-marks)
  ;; now fancy stuff over direded files
  (message (dired-get-marked-files))
)


Whatever I tried, it does dired, it finds correctly files I want, however
the execution of this function stops after find-dired and no further
functions
are called (starting from dired-toggle-marks). Why?

What I'm trying to do is to write a simple function, which replaces
occurence of one signal name to another one within a particular project.
Normally I do it by
hand by issuing dired mode to look for all *.vhd and *.qsf, replacing old
signal name by new using dired-do-query-replace-regexp. Then I have to do
this procedure
once more with *.do files (modelsim), but this time convert the replaced
signal completely to lowercase and replace by its lowercase variant. This
permits to rename
a single signal of VHDL code within all the Quartus project.

The function above is just a start of generation of first dired buffer. But
maybe someone else has better idea how to do...

thanks
david

[-- Attachment #2: Type: text/html, Size: 1376 bytes --]

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

* Re: lisp execution stops after dired
  2011-07-18 11:18 lisp execution stops after dired David Belohrad
@ 2011-07-19 20:34 ` Valentin Plechinger
  0 siblings, 0 replies; 2+ messages in thread
From: Valentin Plechinger @ 2011-07-19 20:34 UTC (permalink / raw)
  To: Help-gnu-emacs

I'm not that fluent in lisp but I think you need something like

(defun vhdl-rename-signal (searchDir)
   "renames signal starting from searchDir"
   (interactive "DEnter top-level directory to search: ")
   ;; first do dired
   (progn
     (find-dired searchDir "-name \*.vhd -or -name \*.qsf")
     (dired-toggle-marks)
     ;; now fancy stuff over direded files
     (message (dired-get-marked-files))))

haven't checked your wether each of your lines actually does what it should
have a look at http://www.rattlesnake.com/intro/progn.html

best regards

At Mon, 18 Jul 2011 13:18:29 +0200,
David Belohrad wrote:
> 
> [1  <text/plain; UTF-8 (7bit)>]
> Dear All.
> 
> have this:
> 
> (defun vhdl-rename-signal (searchDir)
>   "renames signal starting from searchDir"
>   (interactive "DEnter top-level directory to search: ")
>   ;; first do dired
>   (find-dired searchDir "-name \*.vhd -or -name \*.qsf")
>   (dired-toggle-marks)
>   ;; now fancy stuff over direded files
>   (message (dired-get-marked-files))
> )




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

end of thread, other threads:[~2011-07-19 20:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-18 11:18 lisp execution stops after dired David Belohrad
2011-07-19 20:34 ` Valentin Plechinger

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