.emacs-my
changeset 1194 14d42e7c9224
parent 1193 4f46f97a10e9
child 1195 33fd66648b2a
equal deleted inserted replaced
1193:4f46f97a10e9 1194:14d42e7c9224
  2306   (require 'etags-select)
  2306   (require 'etags-select)
  2307   (global-set-key "\M-." 'etags-select-find-tag)
  2307   (global-set-key "\M-." 'etags-select-find-tag)
  2308   )
  2308   )
  2309 
  2309 
  2310 (setq tags-add-tables t)
  2310 (setq tags-add-tables t)
  2311 (global-set-key [M-return] 'complete-tag)
  2311 
       
  2312 (defvar my-ido-tag-history nil
       
  2313   "History of tags selected using `my-ido-complete-tag'.")
       
  2314 (defun my-ido-complete-tag (&optional substr)
       
  2315   "Find a tag using ido."
       
  2316   (tags-completion-table)
       
  2317   (let ( tag-names )
       
  2318     (mapatoms (lambda (x) (push (symbol-name x) tag-names)) tags-completion-table)
       
  2319     (ido-completing-read "Tag: " tag-names nil t substr 'my-ido-tag-history)))
       
  2320 (defun my-complete-tag (prefix point)
       
  2321   (interactive "P\nd")
       
  2322   (if prefix
       
  2323       (funcall #'complete-tag)
       
  2324     (let ( (bounds (find-tag-default-bounds)) tag )
       
  2325       (if (or (not bounds) (< point (car bounds)) (< (cdr bounds) point))
       
  2326           (setq tag (my-ido-complete-tag))
       
  2327         (setq tag (my-ido-complete-tag (buffer-substring (car bounds) (cdr bounds))))
       
  2328         (delete-region (car bounds) (cdr bounds)))
       
  2329       (insert tag))))
       
  2330 
       
  2331 (global-set-key [M-return] #'my-complete-tag)
  2312 
  2332 
  2313 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2333 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2314 (message "CEDET, semantic, SRecord")
  2334 (message "CEDET, semantic, SRecord")
  2315 
  2335 
  2316 ;; For debug use 'semantic-debug-idle-function' and 'semantic-debug-idle-work-function'.
  2336 ;; For debug use 'semantic-debug-idle-function' and 'semantic-debug-idle-work-function'.