1

I am new to Emacs on Windows XP and have multiple queries which I could not find/understand after a lot of search.

  1. I understand that speedbar will support showing of C functions list. As mentioned in http://stackoverflow.com/questions/259364/how-do-i-configure-emacs-speedbar-for-c-sharp-mode, I added the code in .emacs as
    (speedbar 1)
       (add-to-list 'speedbar-fetch-etags-parse-list
                    '("\\.c" . speedbar-parse-c-or-c++tag))
    
    I see the speedbar startup but it never shows the functions. Maybe I need to install etags but cannot find it. I also found gtags but could never find a binary
  2. I copied sr-speedbar.el in ~/emacs.d/ directory. I added (require 'sr-speedbar) in .emacs, commented out speedbar related code, reloaded M-x ~/.emacs but did not find any sr-speedbar. If I uncomment speedbar code and comment sr-speedbar, it shows the speedbar on loading. Emacs is able to find sr-speedbar.el in ~/emacs.d/ directory since if I change filename, it shows an error: unable to find sr-speedbar.
  3. I wanted to make a keyboard macro for logging using tramp and ssh. However, when I record a macro, I have to delete multiple characters to provide the path from the beginnig i.e. emacs automatically shows the last path and so I have to delete all the characeters and then start again with ssh://. The keyboard macro records all backspaces and returns error if the backspaces are more than the length of the current path. Is there a way to avoid it
  4. I configured linum package. I want it to start at the beginning of emacs session automatically with typing M-x linum. How can I do that?
  5. Is there way to retrieve command history (not shell commands) and then replay some command Thanks again for patience on reading until the point :-)
pmr
  • 58,701
  • 10
  • 113
  • 156
doon
  • 2,311
  • 7
  • 31
  • 52
  • I tried to repair some of your formatting. Please split your question into multiple. The bullet points largely have nothing to do with each other. – pmr Nov 23 '12 at 21:58

2 Answers2

4
  1. For C, C++, and other languages, supported by CEDET/Semantic, the Speedbar is able to show functions & other objects. But you need to setup Semantic correctly, for example, you can use my article in CEDET.

  2. As I understand, to enable linum-mode globally, you need to put (global-linum-mode 1) into your ~/.emacs

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
  • Thank you for the response. 2 worked. However, 1 did not. Speedbar still shows the directories. I have this in my .emacs file semantic-mode 1) (defun my-semantic-hook () (imenu-add-to-menubar "TAGS")) (add-hook 'semantic-init-hooks 'my-semantic-hook) (speedbar 1) (custom-set-variables '(speedbar-show-unknown-files t) The last part of custom-set-variables is from http://stackoverflow.com/questions/2220005/how-do-i-enable-speedbar-to-display-all-types-of-files?rq=1. Also, I do see messages parsing the C files. The functions don't show up though. Please advise.Thanks – doon Nov 24 '12 at 08:12
  • which version of CEDET do you have? – Alex Ott Nov 24 '12 at 09:59
  • Thanks. CEDET version is 1.0. I am now reading the previous version of the article in the response. I still cannot see how to make speedbar list the functions but will read it multiple times to see if I am missing anything. Since I have WinXP with emacs, I don't think I can upgdate the package – doon Nov 24 '12 at 10:54
  • I have been able to get Tags menu on the menu bar of emacs with proper parsing. I also downloaded ctags ctags.exe in the path in my attempt to make this work from speedbar. However, I have not been able to do that. This is how my .emacs look currently (in another comment) – doon Nov 24 '12 at 11:57
  • require 'linum) (semantic-mode 1) (defun my-semantic-hook () (imenu-add-to-menubar "TAGS")) (add-hook 'semantic-init-hooks 'my-semantic-hook) (speedbar 1) (custom-set-variables '(speedbar-show-unknown-files t) ) (global-ede-mode 1) (autoload 'speedbar "speedbar") (setq speedbar-fetch-etags-command "C:\ctags\ctags.exe" speedbar-fetch-etags-arguments '("-f" "-")) (global-set-key [f8] 'speedbar-get-focus) (add-to-list 'load-path "~/.emacs.d/") (global-linum-mode 1) /10/introduction-to-ido-mode/ (setq ido-enable-flex-matching t) (setq ido-everywhere t) (ido-mode 1) – doon Nov 24 '12 at 11:58
  • for CEDET 1.0, you need to use another activation method - it described in previous version of article. You need at least specify one of `(semantic-load-...)` functions - see my old config https://github.com/alexott/emacs-configs/blob/master/rc/emacs-rc-cedet-old.el. And it's better to take at least version 1.1 - C/C++ parsing is heavily improved there – Alex Ott Nov 24 '12 at 14:18
2

For 3, there are two options:

  • just type "/ssh:blabla" at the end of the pre-inserted directory (this directory will be ignored as witnessed by it becoming grey).

  • do C-a C-k to erase the content of the minibuffer.

For 5, there is repeat-complex-command bound to C-x ESC ESC and there is repeat bound to C-x z.

Stefan
  • 27,908
  • 4
  • 53
  • 82
  • Thanks 1. worked great. For 5. I keep on getting message that 'repeat can't intuit what you inserted before auto-fill clobbered it'. C-x z is not bound to repeat. I did M-x repeat.Also, as pmr correctly pointed out, this was a set of unrelated questions so even though you gave correct answers, I can only mark one of the posters as accepted. I apologise and can post separate queries to which you can respond. Sorry. Thanks for the help. – doon Nov 24 '12 at 08:16
  • By default `C-x z` is bound to `repeat` at least since Emacs-20. If it's not the case for you, it's probably due to a local configuration. – Stefan Nov 24 '12 at 14:17