unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#8311: 24.0.50; [PATCH] eshell-eval-using-options duplicate symbols
@ 2011-03-21 18:08 Leo
  2011-03-21 20:31 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Leo @ 2011-03-21 18:08 UTC (permalink / raw)
  To: 8311

The macro expansion of eshell-eval-using-options in eshell/ln looks like
this:

(let
    ((temp-args args))
  (let
      (eshell-option-stub symbolic em-interactive force em-preview em-verbose eshell-option-stub eshell-option-stub eshell-option-stub eshell-option-stub eshell-option-stub eshell-option-stub usage-msg last-value ext-command args)
    (eshell-do-opt "ln"
                   '((104 "help" nil nil "show this usage screen")
                     (115 "symbolic" nil symbolic "make symbolic links instead of hard links")
                     (105 "interactive" nil em-interactive "request confirmation if target already exists")
                     (102 "force" nil force "remove existing destinations, never prompt")
                     (110 "preview" nil em-preview "don't change anything on disk")
                     (118 "verbose" nil em-verbose "explain what is being done")
                     :preserve-args :external "ln" :show-usage :usage "[OPTION]... TARGET [LINK_NAME]\n   or:  ln [OPTION]... TARGET... DIRECTORY\nCreate a link to the specified TARGET with optional LINK_NAME.  If there is\nmore than one TARGET, the last argument must be a directory;  create links\nin DIRECTORY to each TARGET.  Create hard links by default, symbolic links\nwith '--symbolic'.  When creating hard links, each TARGET must exist.")
                   '((let
                         ((no-dereference t))
                       (eshell-mvcpln-template "ln" "linking"
                                               (if symbolic 'make-symbolic-link 'add-name-to-file)
                                               eshell-ln-interactive-query eshell-ln-overwrite-files))))))

The second let has quite a few duplicate symbols. Anybody seeing any
problem with the following patch:

=== modified file 'lisp/eshell/esh-opt.el'
--- lisp/eshell/esh-opt.el	2011-03-21 06:42:23 +0000
+++ lisp/eshell/esh-opt.el	2011-03-21 18:04:57 +0000
@@ -102,11 +102,12 @@
 	       macro-args
 	     (list 'eshell-stringify-list
 		   (list 'eshell-flatten-list macro-args)))))
-     (let ,(append (mapcar (lambda (opt)
-			     (or (and (listp opt) (nth 3 opt))
-				 'eshell-option-stub))
-			   (cadr options))
-		   '(usage-msg last-value ext-command args))
+     (let ,(delete-dups
+	    (append (mapcar (lambda (opt)
+			      (or (and (listp opt) (nth 3 opt))
+				  'eshell-option-stub))
+			    (cadr options))
+		    '(usage-msg last-value ext-command args)))
        (eshell-do-opt ,name ,options (quote ,body-forms)))))
 
 ;;; Internal Functions:






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

end of thread, other threads:[~2011-03-22  0:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-21 18:08 bug#8311: 24.0.50; [PATCH] eshell-eval-using-options duplicate symbols Leo
2011-03-21 20:31 ` Glenn Morris
2011-03-22  0:57   ` Leo

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