GNU bug report logs - #8311
24.0.50; [PATCH] eshell-eval-using-options duplicate symbols

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Mon, 21 Mar 2011 18:09:02 UTC

Severity: wishlist

Tags: notabug, patch

Found in version 24.0.50

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8311 in the body.
You can then email your comments to 8311 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8311; Package emacs. (Mon, 21 Mar 2011 18:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo <sdl.web <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 21 Mar 2011 18:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50; [PATCH] eshell-eval-using-options duplicate symbols
Date: Tue, 22 Mar 2011 02:08:17 +0800
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:





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8311; Package emacs. (Mon, 21 Mar 2011 20:32:02 GMT) Full text and rfc822 format available.

Message #8 received at 8311 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Leo <sdl.web <at> gmail.com>
Cc: 8311 <at> debbugs.gnu.org
Subject: Re: bug#8311: 24.0.50;
	[PATCH] eshell-eval-using-options duplicate symbols
Date: Mon, 21 Mar 2011 16:31:02 -0400
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)))))




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8311; Package emacs. (Tue, 22 Mar 2011 00:58:02 GMT) Full text and rfc822 format available.

Message #11 received at 8311 <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 8311 <at> debbugs.gnu.org
Subject: Re: bug#8311: 24.0.50;
	[PATCH] eshell-eval-using-options duplicate symbols
Date: Tue, 22 Mar 2011 08:57:01 +0800
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




bug closed, send any further explanations to 8311 <at> debbugs.gnu.org and Leo <sdl.web <at> gmail.com> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 23 Mar 2011 03:11:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 20 Apr 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 124 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.