all messages for Emacs-related lists mirrored at yhetil.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

* bug#8311: 24.0.50; [PATCH] eshell-eval-using-options duplicate symbols
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Morris @ 2011-03-21 20:31 UTC (permalink / raw)
  To: Leo; +Cc: 8311

Leo wrote:

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

If you're talking about all the `eshell-option-stub's, why not just stop
them being inserted, since they don't seem to be used for anything:


*** lisp/eshell/esh-opt.el	2011-03-21 06:42:23 +0000
--- lisp/eshell/esh-opt.el	2011-03-21 20:26:03 +0000
***************
*** 102,111 ****
  	       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))
         (eshell-do-opt ,name ,options (quote ,body-forms)))))
  
--- 102,110 ----
  	       macro-args
  	     (list 'eshell-stringify-list
  		   (list 'eshell-flatten-list macro-args)))))
!      (let ,(append (delq nil (mapcar (lambda (opt)
! 				       (and (listp opt) (nth 3 opt)))
! 				     (cadr options)))
  		   '(usage-msg last-value ext-command args))
         (eshell-do-opt ,name ,options (quote ,body-forms)))))





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

* bug#8311: 24.0.50; [PATCH] eshell-eval-using-options duplicate symbols
  2011-03-21 20:31 ` Glenn Morris
@ 2011-03-22  0:57   ` Leo
  0 siblings, 0 replies; 3+ messages in thread
From: Leo @ 2011-03-22  0:57 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 8311

On 2011-03-22 04:31 +0800, Glenn Morris wrote:
> If you're talking about all the `eshell-option-stub's, why not just stop
> them being inserted, since they don't seem to be used for anything:

Indeed there is only one occurrence of eshell-option-stub in the eshell
source. So your patch fixes the bug too. Please install it. Thanks.

Leo





^ 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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.