[slime-devel] Suggested patch (Re: Emacs menus and warnings)

Alex Goncharov alex-goncharov at comcast.net
Thu Apr 15 23:50:50 UTC 2010


,--- I/Alex (Thu, 15 Apr 2010 12:29:50 -0400) ----*
| ,--- You/Mark (Thu, 15 Apr 2010 12:24:25 -0400) ----*
| | > Separately, FYI, these are the warnings I get compiling the freshest
| | >     slime.el:4717:20:Warning: `next-line' used from Lisp code
| | >     That command is designed for interactive use only
| | 
| | http://article.gmane.org/gmane.lisp.slime.devel/9508
| | http://article.gmane.org/gmane.lisp.slime.devel/9509
| | 
| | Unfortunately for the SLIME developers, this could be a recurring
| | message as new users come to SLIME and notice the warnings.
| 
| What's the process of fixing such things?  If I happen to be able to
| fix this, send a patch to this list?
|
`-------------------------------------------------*

Index: slime.el
===================================================================

RCS file: /project/slime/cvsroot/slime/slime.el,v
retrieving revision 1.1300
diff -u -p -w -r1.1300 slime.el
--- slime.el	14 Apr 2010 17:51:47 -0000	1.1300
+++ slime.el	15 Apr 2010 23:47:40 -0000
@@ -3611,13 +3611,19 @@ Return true if the configuration was sav
        (when (buffer-live-p slime-completions-buffer-name)
          (kill-buffer slime-completions-buffer-name))))))
 
+(defmacro slime-is-last-char-in-set (string)
+  (if (boundp 'last-command-event)
+      `(find last-command-event ,string)
+    `(find last-command-char ,string)))
+
 (defun slime-complete-maybe-restore-window-configuration ()
   "Restore the window configuration, if the following command
 terminates a current completion."
   (remove-hook 'pre-command-hook
                'slime-complete-maybe-restore-window-configuration)
+  
   (condition-case err
-      (cond ((find last-command-char "()\"'`,# \r\n:")
+      (cond ((slime-is-last-char-in-set "()\"'`,# \r\n:")
              (slime-complete-restore-window-configuration))
             ((not (slime-completion-window-active-p))
              (slime-complete-forget-window-configuration))
@@ -4710,12 +4716,24 @@ The most important commands:
   (setq delayed-mode-hooks nil)
   (slime-mode -1))
 
+(with-no-warnings 
+  (defun slime-next-line ()
+    (interactive)
+    (next-line))
+  (defun slime-previous-line ()
+    (interactive)
+    (previous-line))
+  (defun slime-next-line/not-add-newlines ()
+  (interactive)
+  (let ((next-line-add-newlines nil))
+    (next-line 1))))
+
 (slime-define-keys slime-xref-mode-map
   ((kbd "RET") 'slime-goto-xref)
   ((kbd "SPC") 'slime-goto-xref)
   ("v" 'slime-show-xref)
-  ("n" (lambda () (interactive) (next-line)))
-  ("p" (lambda () (interactive) (previous-line)))
+  ("n" 'slime-next-line)
+  ("p" 'slime-previous-line)
   ("\C-c\C-c" 'slime-recompile-xref)
   ("\C-c\C-k" 'slime-recompile-all-xrefs)
   ("\M-," 'slime-xref-retract)
@@ -4725,11 +4743,6 @@ The most important commands:
   ([down] 'slime-xref-next-line)
   ([up] 'slime-xref-prev-line))
 
-(defun slime-next-line/not-add-newlines ()
-  (interactive)
-  (let ((next-line-add-newlines nil))
-    (next-line 1)))
-
 
 ;;;;; XREF results buffer and window management

-- Alex -- alex-goncharov at comcast.net --




More information about the slime-devel mailing list