diff lisp/cmdloop.el @ 4806:fd36a980d701

Use uninterned symbols in various information-hiding contexts. lisp/ChangeLog addition: 2010-01-01 Aidan Kehoe <kehoea@parhasard.net> * syntax.el (map-syntax-table): * subr.el (map-plist): * startup.el (load-init-file): * minibuf.el (read-from-minbuffer): * cus-edit.el (custom-load-custom-defines-1): * cmdloop.el (execute-extended-command): Replace symbol names using underscore, whether to avoid dynamic scope problems or to ensure helpful arguments to #'call-with-condition-handler, with uninterned symbols. src/ChangeLog addition: 2010-01-01 Aidan Kehoe <kehoea@parhasard.net> * mule-charset.c (Fmake_charset): Don't intern the symbols used to refer to temporary character sets, that doesn't bring us anything.
author Aidan Kehoe <kehoea@parhasard.net>
date Fri, 01 Jan 2010 19:45:39 +0000
parents 38ef5a6da799
children 9fa29ec759e3
line wrap: on
line diff
--- a/lisp/cmdloop.el	Sat Dec 05 01:04:17 2009 +0900
+++ b/lisp/cmdloop.el	Fri Jan 01 19:45:39 2010 +0000
@@ -344,35 +344,36 @@
   (if (and teach-extended-commands-p
 	   (interactive-p))
       ;; Remember the keys, run the command, and show the keys (if
-      ;; any).  The funny variable names are a poor man's guarantee
-      ;; that we don't get tripped by this-command doing something
-      ;; funny.  Quoth our forefathers: "We want lexical scope!"
-      (let ((_execute_command_keys_ (where-is-internal this-command))
-	    (_execute_command_name_ this-command)) ; the name can change
-	(command-execute this-command t)
-	(when _execute_command_keys_
-	  ;; Normally the region is adjusted in post_command_hook;
-	  ;; however, it is not called until after we finish.  It
-	  ;; looks ugly for the region to get updated after the
-	  ;; delays, so we do it now.  The code below is a Lispified
-	  ;; copy of code in event-stream.c:post_command_hook().
-	  (if (and (not zmacs-region-stays)
-		   (or (not (eq (selected-window) (minibuffer-window)))
-		       (eq (zmacs-region-buffer) (current-buffer))))
-	      (zmacs-deactivate-region)
-	    (zmacs-update-region))
-	  ;; Wait for a while, so the user can see a message printed,
-	  ;; if any.
-	  (when (sit-for 1)
-	    (display-message
-		'no-log
-	      (format (if (cdr _execute_command_keys_)
-			  "Command `%s' is bound to keys: %s"
-			"Command `%s' is bound to key: %s")
-		      _execute_command_name_
-		      (sorted-key-descriptions _execute_command_keys_)))
-	    (sit-for teach-extended-commands-timeout)
-	    (clear-message 'no-log))))
+      ;; any).  The symbol-macrolet avoids some lexical-scope lossage.
+      (symbol-macrolet
+	  ((execute-command-keys #:execute-command-keys)
+	   (execute-command-name #:execute-command-name))
+	(let ((execute-command-keys (where-is-internal this-command))
+	      (execute-command-name this-command)) ; the name can change
+	  (command-execute this-command t)
+	  (when execute-command-keys
+	    ;; Normally the region is adjusted in post_command_hook;
+	    ;; however, it is not called until after we finish.  It
+	    ;; looks ugly for the region to get updated after the
+	    ;; delays, so we do it now.  The code below is a Lispified
+	    ;; copy of code in event-stream.c:post_command_hook().
+	    (if (and (not zmacs-region-stays)
+		     (or (not (eq (selected-window) (minibuffer-window)))
+			 (eq (zmacs-region-buffer) (current-buffer))))
+		(zmacs-deactivate-region)
+	      (zmacs-update-region))
+	    ;; Wait for a while, so the user can see a message printed,
+	    ;; if any.
+	    (when (sit-for 1)
+	      (display-message
+		  'no-log
+		(format (if (cdr execute-command-keys)
+			    "Command `%s' is bound to keys: %s"
+			  "Command `%s' is bound to key: %s")
+			execute-command-name
+			(sorted-key-descriptions execute-command-keys)))
+	      (sit-for teach-extended-commands-timeout)
+	      (clear-message 'no-log)))))
     ;; Else, just run the command.
     (command-execute this-command t)))