@@ -929,7 +929,7 @@ output buffer."
929929 (:eval (ce--header-line-format-common))
930930 " | "
931931 ,(propertize
932- (format " Tool: %s " (ce--tool-id ))
932+ (format " Tool: %s " (ce--tool-name (ce--tool-id) ))
933933 'mouse-face 'header-line-highlight
934934 'keymap (let ((map (make-keymap ))
935935 (id (ce--tool-id)))
@@ -1063,7 +1063,7 @@ output buffer."
10631063 (not (seq-empty-p (ce--tools (plist-get ce--language-data :id ))))
10641064 ,@(mapcar
10651065 (pcase-lambda (`(, id . , _ ))
1066- (vector id
1066+ (vector (ce--tool-name id)
10671067 (lambda ()
10681068 (interactive )
10691069 (ce-add-tool id))
@@ -1074,14 +1074,15 @@ output buffer."
10741074 :enable (not (null ce--selected-tools))
10751075 ,@(mapcar
10761076 (lambda (id )
1077- (vector id (lambda () (interactive ) (ce-remove-tool id))))
1077+ (vector (ce--tool-name id)
1078+ (lambda () (interactive ) (ce-remove-tool id))))
10781079 (mapcar #'car ce--selected-tools)))
10791080 (" Set tool arguments"
10801081 :enable (not (null ce--selected-tools))
10811082 ,@(mapcar
10821083 (lambda (id )
10831084 (vector
1084- id
1085+ (ce--tool-name id)
10851086 (lambda ()
10861087 (interactive )
10871088 (let ((ce--tool-context id))
@@ -1090,7 +1091,7 @@ output buffer."
10901091 (" Set tool input"
10911092 :enable (not (null ce--selected-tools))
10921093 ,@(mapcar
1093- (lambda (id ) (vector id
1094+ (lambda (id ) (vector (ce--tool-name id)
10941095 (lambda ()
10951096 (interactive )
10961097 (let ((ce--tool-context id))
@@ -1140,6 +1141,14 @@ output buffer."
11401141 " Get the ID of the tool in the current buffer, or return nil."
11411142 (car (cl-find (current-buffer ) ce--selected-tools :key #'cadr )))
11421143
1144+ (defun ce--tool-name (id )
1145+ " Return the name of a tool with given ID."
1146+ (let* ((lang (or (and (ce-active-p)
1147+ (plist-get ce--language-data :id ))
1148+ (error " Not in a `compiler-explorer' session " )))
1149+ (tool-data (map-elt (ce--tools lang) id)))
1150+ (or (plist-get tool-data :name ) id)))
1151+
11431152(defun ce--window-layout (&optional window )
11441153 " Get the window layout of WINDOW, suitable for `compiler-explorer-layout' .
11451154WINDOW if nil defaults to the frame's root window."
@@ -1957,12 +1966,15 @@ The tool's buffer is active when this hook runs.")
19571966 (let* ((lang (or (and (ce-active-p)
19581967 (plist-get ce--language-data :id ))
19591968 (user-error " Not in a `compiler-explorer' session" )))
1960- (candidates (mapcar #'car (ce--tools lang)))
1969+ (candidates (mapcar
1970+ (lambda (id ) (cons (ce--tool-name id) id))
1971+ (mapcar #'car (ce--tools lang))))
19611972 (res (completing-read
19621973 " Add tool: " candidates
19631974 ; ; Ignore tools that are already added.
19641975 (lambda (id ) (null (assoc id ce--selected-tools)))
1965- t )))
1976+ t ))
1977+ (res (map-elt candidates res)))
19661978 (list res)))
19671979 (unless (ce-active-p)
19681980 (error " Not in a `compiler-explorer' session " ))
@@ -1971,7 +1983,7 @@ The tool's buffer is active when this hook runs.")
19711983 (error " Tool %s already added " id))
19721984
19731985 (let ((buf (generate-new-buffer
1974- (format ce--tool-buffer-format id )))
1986+ (format ce--tool-buffer-format (ce--tool-name id) )))
19751987 window)
19761988 (push (list id buf " " " " ) ce--selected-tools)
19771989 (unless noninteractive
@@ -1999,9 +2011,12 @@ Each function is called with one argument, the tool id.")
19992011 " Remove tool ID from the current compilation."
20002012 (interactive
20012013 (if (ce-active-p)
2002- (let ((tools (mapcar #'car ce--selected-tools)))
2003- (list (completing-read " Remove tool: " tools nil t nil nil
2004- (ce--tool-id))))
2014+ (let* ((candidates (mapcar
2015+ (lambda (id ) (cons (ce--tool-name id) id))
2016+ (mapcar #'car ce--selected-tools)))
2017+ (res (completing-read " Remove tool: " candidates nil t ))
2018+ (res (map-elt candidates res)))
2019+ (list res))
20052020 (user-error " Not in a `compiler-explorer' session" )))
20062021 (unless (ce-active-p)
20072022 (error " Not in a `compiler-explorer' session " ))
0 commit comments