unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Horrible kludge in ff-get-file
@ 2006-07-16 17:31 Richard Stallman
  2006-07-16 18:14 ` Thien-Thi Nguyen
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Stallman @ 2006-07-16 17:31 UTC (permalink / raw)


I just saw this code in ada-mode.el

  ;; Another special construct for find-file.el : when in a separate clause,
  ;; go to the correct package.
  (add-to-list 'ff-special-constructs
               (cons "^separate[ \t\n]*(\\(\\(\\sw\\|[_.]\\)+\\))"
                     (lambda ()
		       (if (fboundp 'ff-get-file)
			   (if (boundp 'fname)
			       (setq fname (ff-get-file
					    ada-search-directories-internal
					    (ada-make-filename-from-adaname
					     (match-string 1))
					    ada-spec-suffixes)))))))

This would be clean if fname were renamed to a clean meaningful name
and had a defvar.

Would someone please do that?

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

* Re: Horrible kludge in ff-get-file
  2006-07-16 17:31 Horrible kludge in ff-get-file Richard Stallman
@ 2006-07-16 18:14 ` Thien-Thi Nguyen
  0 siblings, 0 replies; 2+ messages in thread
From: Thien-Thi Nguyen @ 2006-07-16 18:14 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

>   ;; Another special construct for find-file.el : when in a separate clause,
>   ;; go to the correct package.
>   (add-to-list 'ff-special-constructs
>                (cons "^separate[ \t\n]*(\\(\\(\\sw\\|[_.]\\)+\\))"
>                      (lambda ()
> 		       (if (fboundp 'ff-get-file)
> 			   (if (boundp 'fname)
> 			       (setq fname (ff-get-file
> 					    ada-search-directories-internal
> 					    (ada-make-filename-from-adaname
> 					     (match-string 1))
> 					    ada-spec-suffixes)))))))
> 
> This would be clean if fname were renamed to a clean meaningful name
> and had a defvar.
> 
> Would someone please do that?

there is a cleaner fix: better document `ff-special-constructs'
so that the thunk's return value is both necessary and sufficient
to do the job (no need for `setq' or knowledge of `fname').

also, the binding checks are remnants from the time before
`ff-special-constructs' was autoloaded; they can be removed.

i will make these changes shortly.

thi

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

end of thread, other threads:[~2006-07-16 18:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-16 17:31 Horrible kludge in ff-get-file Richard Stallman
2006-07-16 18:14 ` Thien-Thi Nguyen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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