unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#1063: improvement of elint.el
@ 2008-10-01 14:41 ` Shigeru Fukaya
  2009-11-14 20:10   ` bug#1063: marked as done (improvement of elint.el) Emacs bug Tracking System
  0 siblings, 1 reply; 2+ messages in thread
From: Shigeru Fukaya @ 2008-10-01 14:41 UTC (permalink / raw)
  To: bug-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 438 bytes --]

Hello,

I changed elint.el to work better in the latest Emacs.

Revised features are,

 * Regard more variables as defined.

   - Variables defined in C source without help string.
     (by preset in elint-standard-variables)

   - Variables having entries in DOC file.

   - Variables defined in some file, but unbound.

 * Get builtin function arguments properly.
   (adapt to current (fn ARG1 ARG2...) document form)

Regards,
Shigeru

[-- Attachment #2: elint.diff --]
[-- Type: text/plain, Size: 3625 bytes --]

*** elint.el	Tue May  6 22:54:43 2008
--- elint-new.el	Wed Oct  1 23:23:27 2008
***************
*** 68,74 ****
       overwrite-mode
       point-before-scroll right-fringe-width right-margin-width
       scroll-bar-width scroll-down-aggressively scroll-up-aggressively selective-display
!      selective-display-ellipses tab-width truncate-lines vc-mode vertical-scroll-bar)
    "Standard buffer local vars.")
  
  (defconst elint-unknown-builtin-args
--- 68,78 ----
       overwrite-mode
       point-before-scroll right-fringe-width right-margin-width
       scroll-bar-width scroll-down-aggressively scroll-up-aggressively selective-display
!      selective-display-ellipses tab-width truncate-lines vc-mode vertical-scroll-bar
!      ;; bound, defined in some C source, and no help.
!      activate-menubar-hook buffer-name-history coding-system-history
!      extended-command-history kbd-macro-termination-hook
!      minibuffer-default read-expression-history yes-or-no-p-history)
    "Standard buffer local vars.")
  
  (defconst elint-unknown-builtin-args
***************
*** 461,467 ****
    (not (or (eq var nil)
  	   (eq var t)
  	   (elint-env-find-var env var)
! 	   (memq var elint-standard-variables))))
  
  ;;;
  ;;; Function argument checking
--- 465,476 ----
    (not (or (eq var nil)
  	   (eq var t)
  	   (elint-env-find-var env var)
! 	   (memq var elint-standard-variables)
! 	   ;; symbol in DOC may be bound at runtime.
! 	   (numberp (get var 'variable-documentation))
! 	   (numberp (cdr-safe (get var 'variable-documentation)))
! 	   ;; symbol in some loaded file may be bound at runtime.
! 	   (symbol-file var))))
  
  ;;;
  ;;; Function argument checking
***************
*** 770,778 ****
  			(eq (cdr x) 'unknown)
  			(put (car x) 'elint-args (cdr x)))))
  	(elint-find-builtin-args))
!   (mapcar (function (lambda (x)
  		      (put (car x) 'elint-args (cdr x))))
! 	  elint-unknown-builtin-args))
  
  
  (defun elint-find-builtins ()
--- 779,787 ----
  			(eq (cdr x) 'unknown)
  			(put (car x) 'elint-args (cdr x)))))
  	(elint-find-builtin-args))
!   (mapc (function (lambda (x)		;;; mapcar
  		      (put (car x) 'elint-args (cdr x))))
! 	elint-unknown-builtin-args))
  
  
  (defun elint-find-builtins ()
***************
*** 783,788 ****
--- 792,798 ----
      subrs
      ))
  
+ 
  (defun elint-find-builtin-args (&optional list)
    "Returns a list of the built-in functions and their arguments.
  
***************
*** 792,808 ****
  Each functions is represented by a cons cell:
  \(function-symbol . args)
  If no documentation could be found args will be `unknown'."
  
-     (mapcar (function (lambda (f)
- 			(let ((doc (documentation f t)))
- 			  (if (and doc (string-match "\n\n\\((.*)\\)" doc))
- 			      (read (match-string 1 doc))
- 			    (cons f 'unknown))
- 			  )))
- 	    (if list list
- 	      (elint-find-builtins))))
  
  (provide 'elint)
- 
- ;; arch-tag: b2f061e2-af84-4ddc-8e39-f5e969ac228f
- ;;; elint.el ends here
--- 802,822 ----
  Each functions is represented by a cons cell:
  \(function-symbol . args)
  If no documentation could be found args will be `unknown'."
+   (mapcar (lambda (f)
+ 	    (let ((doc (documentation f t))
+ 		  exp)
+ 	      (if (and doc (string-match "\n\n\\((.*)\\)" doc))
+ 		  (progn
+ 		    (setq exp (match-string 1 doc))
+ 		    ;; replace (fn ARG...) to (name arg...)
+ 		    (read
+ 		     (if (string-match "\\`(\\(fn\\) " exp)
+ 			 (replace-match (symbol-name f) nil t
+ 					(downcase exp) 1)
+ 		       exp)))
+ 		(cons f 'unknown))))
+ 	  (if list list
+ 	    (elint-find-builtins))))
  
  
  (provide 'elint)

[-- Attachment #3: ChangeLog.elint --]
[-- Type: text/plain, Size: 351 bytes --]

	* elint-new.el (elint-standard-variables): Add symbols that are
	bound, defined in some C source, and have no help.
	(elint-unbound-variable): Check if symbol has document in DOC, or
	defined or loaded in some file.
	(elint-initialize): mapcar to mapc.
	(elint-find-builtin-args): Adapt to the current function document
	style `(fn ARGS...)'.

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

* bug#1063: marked as done (improvement of elint.el)
  2008-10-01 14:41 ` bug#1063: improvement of elint.el Shigeru Fukaya
@ 2009-11-14 20:10   ` Emacs bug Tracking System
  0 siblings, 0 replies; 2+ messages in thread
From: Emacs bug Tracking System @ 2009-11-14 20:10 UTC (permalink / raw)
  To: Glenn Morris

[-- Attachment #1: Type: text/plain, Size: 846 bytes --]

Your message dated Sat, 14 Nov 2009 15:00:24 -0500
with message-id <ufocn4j2qv.fsf@fencepost.gnu.org>
and subject line Re: Bug#1063: improvement of elint.el
has caused the Emacs bug report #1063,
regarding improvement of elint.el
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
1063: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1063
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 9244 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 438 bytes --]

Hello,

I changed elint.el to work better in the latest Emacs.

Revised features are,

 * Regard more variables as defined.

   - Variables defined in C source without help string.
     (by preset in elint-standard-variables)

   - Variables having entries in DOC file.

   - Variables defined in some file, but unbound.

 * Get builtin function arguments properly.
   (adapt to current (fn ARG1 ARG2...) document form)

Regards,
Shigeru

[-- Attachment #2.1.2: elint.diff --]
[-- Type: text/plain, Size: 3625 bytes --]

*** elint.el	Tue May  6 22:54:43 2008
--- elint-new.el	Wed Oct  1 23:23:27 2008
***************
*** 68,74 ****
       overwrite-mode
       point-before-scroll right-fringe-width right-margin-width
       scroll-bar-width scroll-down-aggressively scroll-up-aggressively selective-display
!      selective-display-ellipses tab-width truncate-lines vc-mode vertical-scroll-bar)
    "Standard buffer local vars.")
  
  (defconst elint-unknown-builtin-args
--- 68,78 ----
       overwrite-mode
       point-before-scroll right-fringe-width right-margin-width
       scroll-bar-width scroll-down-aggressively scroll-up-aggressively selective-display
!      selective-display-ellipses tab-width truncate-lines vc-mode vertical-scroll-bar
!      ;; bound, defined in some C source, and no help.
!      activate-menubar-hook buffer-name-history coding-system-history
!      extended-command-history kbd-macro-termination-hook
!      minibuffer-default read-expression-history yes-or-no-p-history)
    "Standard buffer local vars.")
  
  (defconst elint-unknown-builtin-args
***************
*** 461,467 ****
    (not (or (eq var nil)
  	   (eq var t)
  	   (elint-env-find-var env var)
! 	   (memq var elint-standard-variables))))
  
  ;;;
  ;;; Function argument checking
--- 465,476 ----
    (not (or (eq var nil)
  	   (eq var t)
  	   (elint-env-find-var env var)
! 	   (memq var elint-standard-variables)
! 	   ;; symbol in DOC may be bound at runtime.
! 	   (numberp (get var 'variable-documentation))
! 	   (numberp (cdr-safe (get var 'variable-documentation)))
! 	   ;; symbol in some loaded file may be bound at runtime.
! 	   (symbol-file var))))
  
  ;;;
  ;;; Function argument checking
***************
*** 770,778 ****
  			(eq (cdr x) 'unknown)
  			(put (car x) 'elint-args (cdr x)))))
  	(elint-find-builtin-args))
!   (mapcar (function (lambda (x)
  		      (put (car x) 'elint-args (cdr x))))
! 	  elint-unknown-builtin-args))
  
  
  (defun elint-find-builtins ()
--- 779,787 ----
  			(eq (cdr x) 'unknown)
  			(put (car x) 'elint-args (cdr x)))))
  	(elint-find-builtin-args))
!   (mapc (function (lambda (x)		;;; mapcar
  		      (put (car x) 'elint-args (cdr x))))
! 	elint-unknown-builtin-args))
  
  
  (defun elint-find-builtins ()
***************
*** 783,788 ****
--- 792,798 ----
      subrs
      ))
  
+ 
  (defun elint-find-builtin-args (&optional list)
    "Returns a list of the built-in functions and their arguments.
  
***************
*** 792,808 ****
  Each functions is represented by a cons cell:
  \(function-symbol . args)
  If no documentation could be found args will be `unknown'."
  
-     (mapcar (function (lambda (f)
- 			(let ((doc (documentation f t)))
- 			  (if (and doc (string-match "\n\n\\((.*)\\)" doc))
- 			      (read (match-string 1 doc))
- 			    (cons f 'unknown))
- 			  )))
- 	    (if list list
- 	      (elint-find-builtins))))
  
  (provide 'elint)
- 
- ;; arch-tag: b2f061e2-af84-4ddc-8e39-f5e969ac228f
- ;;; elint.el ends here
--- 802,822 ----
  Each functions is represented by a cons cell:
  \(function-symbol . args)
  If no documentation could be found args will be `unknown'."
+   (mapcar (lambda (f)
+ 	    (let ((doc (documentation f t))
+ 		  exp)
+ 	      (if (and doc (string-match "\n\n\\((.*)\\)" doc))
+ 		  (progn
+ 		    (setq exp (match-string 1 doc))
+ 		    ;; replace (fn ARG...) to (name arg...)
+ 		    (read
+ 		     (if (string-match "\\`(\\(fn\\) " exp)
+ 			 (replace-match (symbol-name f) nil t
+ 					(downcase exp) 1)
+ 		       exp)))
+ 		(cons f 'unknown))))
+ 	  (if list list
+ 	    (elint-find-builtins))))
  
  
  (provide 'elint)

[-- Attachment #2.1.3: ChangeLog.elint --]
[-- Type: text/plain, Size: 351 bytes --]

	* elint-new.el (elint-standard-variables): Add symbols that are
	bound, defined in some C source, and have no help.
	(elint-unbound-variable): Check if symbol has document in DOC, or
	defined or loaded in some file.
	(elint-initialize): mapcar to mapc.
	(elint-find-builtin-args): Adapt to the current function document
	style `(fn ARGS...)'.

[-- Attachment #3: Type: message/rfc822, Size: 1488 bytes --]

From: Glenn Morris <rgm@gnu.org>
To: 1063-done@emacsbugs.donarmstrong.com
Subject: Re: Bug#1063: improvement of elint.el
Date: Sat, 14 Nov 2009 15:00:24 -0500
Message-ID: <ufocn4j2qv.fsf@fencepost.gnu.org>


I'm sorry for overlooking this report for so long. I have applied the
pieces that are still relevant to Emacs CVS trunk.

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

end of thread, other threads:[~2009-11-14 20:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <ufocn4j2qv.fsf@fencepost.gnu.org>
2008-10-01 14:41 ` bug#1063: improvement of elint.el Shigeru Fukaya
2009-11-14 20:10   ` bug#1063: marked as done (improvement of elint.el) Emacs bug Tracking System

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