Hello Mark,
I wrongfully thought that all people is currently using the latest JDE
2.2.6 :-(
The `semantic-sort-tokens-by-name-inc[dec]reasing' functions are defined
in semantic-util.el (semantic 1.3.1).
For those using previous version of the JDE you can define them as:
(defun semantic-sort-tokens-by-name-increasing (tokens)
"Sort TOKENS by name in increasing order with side effects.
Return the sorted list."
(sort tokens (lambda (a b)
(string-lessp (semantic-token-name a)
(semantic-token-name b)))))
(defun semantic-sort-tokens-by-name-decreasing (tokens)
"Sort TOKENS by name in decreasing order with side effects.
Return the sorted list."
(sort tokens (lambda (a b)
(string-lessp (semantic-token-name b)
(semantic-token-name a)))))
Thank you for your feedback.
Sincerely,
David
>Hi David
>
>>Please try it. Just load the file after the JDE.
>
>Any ideas why I get the following when I try to run your sort routine?
>
>
>
>Symbol's function definition is void: semantic-sort-tokens-by-name-
increasing
>
>Signaling: (void-function semantic-sort-tokens-by-name-increasing)
> (semantic-sort-tokens-by-name-increasing (copy-sequence imports))
> (if reverse (semantic-sort-tokens-by-name-decreasing (copy-sequence
imports)) (semantic-sort-tokens-by-name-increasing (copy-sequence
imports)))
> (let ((sorted-imports ...) l sl changed import start) (setq l
imports) (setq sl sorted-imports) (while (and l ...) (setq changed ...)
(setq l ...) (setq sl ...)) (if (not changed) (message "Import
statements already sorted") (setq sl ...) (goto-char ...) (save-
excursion ... ...)))
> (if imports (let (... l sl changed import start) (setq l imports)
(setq sl sorted-imports) (while ... ... ... ...) (if ... ... ... ...
..)))
> (let* ((tokens ...) (imports ...)) (if imports (let ... ... ... ...
..)))
> jde-sort-imports(nil)
> call-interactively(jde-sort-imports)
> execute-extended-command(nil)
> call-interactively(execute-extended-command)
>
>
>My .emacs file has the following line after all of the JDE files have
been loaded etc:
>
> (load "~/emacs/site/impsort.el")
>
>thanks
>Mark
>