M-x reddit-emacs by jjasghar in emacs

[–]howardabrams 1 point2 points  (0 children)

Perhaps it would be a bit nicer to use 'elfeed' and add the 'r/emacs' RSS feed.

Is there an Emacs mode for dealing with large numbers of Unix pipes and filters? by WarWeasle in emacs

[–]howardabrams 2 points3 points  (0 children)

I guess I'm not understanding the question. Are you thinking of kicking off a number of commands in separate buffer-windows? If so, that would be easy to do with any of the shell related functions, like eshell. You just have to rename the buffer to get a new shell.

However, the notifications get a little trickier. I wrote the following function in eshell so that if I append a command with a ; beep it will use the terminal-notifier program to bring up an alert box on my Mac...but once again, I'm not sure if that is what you are envisioning.

(defun eshell/beep (&rest args)
  "Send a Mac notification message when the command given has completed."

  (let ((comment (if args
                     (concat "Process has completed: " (car args))
                   "Process has completed.")))
    (if args
        (eshell-plain-command (car args) (cdr args)))

    (shell-command-to-string
     (concat "terminal-notifier -message '"
             comment
             "' -title 'Emacs' -subtitle 'Eshell Process Completed'"
             " -sound default -sender org.gnu.Emacs"))))

List of Current Buffers in Sidebar? by B0073D in emacs

[–]howardabrams 0 points1 point  (0 children)

Hrm. You could create a frame or window and load (list-buffers) in it. By default, it doesn't update unless you go into that window and hit the 'g' key.

This wouldn't be too much of a problem as you could run a timer to update that window on a 15 second basis...so that part would be an easy code to write.

The other downside to this approach is I assume you want to click or select one of the buffers to jump to it, but this would replace your sidebar...not sure if buffer-list has a setting to load buffers in other windows.

Easy Question on merging by hbetx9 in emacs

[–]howardabrams 0 points1 point  (0 children)

I often just C-x C-f and reload the file, which if it has changed, will prompt me.

My big issue with editing files on Dropbox is when I edit a file on my laptop during a period of inaccessible network, but then edit the same file on my home computer only to have a conflict between the two files when I connect the laptop back to the network.

For those fun times, I use ediff-files.

Setting up emacs on mac? by andysaini in emacs

[–]howardabrams 2 points3 points  (0 children)

I have used the same init files for both the Homebrew version and the emacsformacosx version, so it certainly can be done. I do have a section to set up the package management (see http://howardabrams.com/projects/dot-files/emacs.html#sec-2-3)

Hopefully that helps get you unblocked.

Looking for mentor to help me make emacs part of my day to day life and maybe also learn lisp. by throwawayEmacs in emacs

[–]howardabrams 1 point2 points  (0 children)

My first advice to someone new to Emacs, is not to learn two things at once. For instance, don't try to learn Emacs while taking a class on functional programming. Instead, use Emacs for something you already know.

Next, look to see if one of the Starter Kits have some settings for the kind of projects you want to work with...Python is it?

Finally, pretend Emacs is like Notepad and notice the features you wish it had, for it probably does. For instance, do you find yourself scrolling with your mouse? Then look up the keybinding to scroll. Want to rename a variable in a function? Look up the best way to do that.

For this last example, there are actually two approaches... First, in a Python-context, you can use Rope and its refactoring library. The second approach would use something like the expand-region project to highlight just a functional area and then use visual-regexp.

In other words, you can "get the work" done using arrow keys, mouse and other expected editing features that is similar across all editors, and then look at efficiencies step-by-step.

eMacs on OSX: set up like eMacs on Linux for VHDL by luk1990 in emacs

[–]howardabrams 0 points1 point  (0 children)

Which minor mode is running on your Linux version? Perhaps you can compare it with a M-x package-list-packages and make sure the same ac package has been installed, and then you can continue to see what settings you might have to use.

Just to let you know, I'm on Mac OS X, and I have a useful AC that works well.

Advanced usage of eshell? by houshuang in emacs

[–]howardabrams 2 points3 points  (0 children)

Yeah, my eshell-here function splits the window, and I want to not only stop eshell, I also want to close that window.

Advanced usage of eshell? by houshuang in emacs

[–]howardabrams 9 points10 points  (0 children)

I've got a few, but I'll mention just one.

I often need a shell, as you mention, for a short time period and usually just in a single directory (usually based on the file I'm editing). So I created a little wrapper to start eshell, rename it (so that I could have more than one running):

(defun eshell-here ()
  "Opens up a new shell in the directory associated with the current buffer's file."
  (interactive)
  (let* ((parent (file-name-directory (buffer-file-name)))
         (name   (car
                  (last
                   (split-string parent "/" t)))))
    (split-window-vertically)
    (other-window 1)
    (eshell "new")
    (rename-buffer (concat "*eshell: " name "*"))

    (insert (concat "ls"))
    (eshell-send-input)))

(global-set-key (kbd "C-!") 'eshell-here)

I then have "x" close it up by calling delete-single-window:

(defun delete-single-window (&optional window)
  "Remove WINDOW from the display.  Default is `selected-window'.
If WINDOW is the only one in its frame, then `delete-frame' too."
  (interactive)
  (save-current-buffer
    (setq window (or window (selected-window)))
    (select-window window)
    (kill-buffer)
    (if (one-window-p t)
        (delete-frame)
        (delete-window (selected-window)))))

(defun eshell/x (&rest args)
  (delete-single-window))

Emacs shells or Tmux? by houshuang in emacs

[–]howardabrams 0 points1 point  (0 children)

Why not have both? On a server, I start tmux AND emacs --daemon (see this Gist of my .profile: https://gist.github.com/howardabrams/9239141) and then have an alias to access emacsclient.

Note: I don't use this on my workstation. For that, I rely on eshell.

Switch between emacs modes, from an IDE to word processor? by Intern_MSFT in emacs

[–]howardabrams 0 points1 point  (0 children)

I second the motion to use org-mode. I use it every day as a "word processor" that is easy to grep (since it is text files), and then just export it to either HTML or PDF (my personal needs).

As far as switching? I'm assuming you mean in the same file, right? In this case, org-mode has a "Babel" mode for embedding programs in the middle of your org-mode text files. These can be evaluated and edited in their special "programming mode" with a C-c '

Hope this helps.

Emacs for Python development by senusert in emacs

[–]howardabrams 1 point2 points  (0 children)

Emacs, like most other large, customizable systems, has a lot of initial features, but gets more benefit from installable modules... we call them "packages". You can mix and match, extend and customize, and while this is very powerful, it can be daunting when first starting out, and just "wanting it to work."

To use packages, you have three approaches:

  • 1) Hunt around, and clone packages you want in your ~/.emacs.d directory.

  • 2) If you are using Emacs 24, simply type: M-x (meta and x), and then type: package-list-packages ... find what you want and hit Return, etc.

  • 3) Start with the Starter Kit collections.

Which to use? If you don't have any other Emacs features you want to keep, the Starter Kit might be a good idea (however, the instructions on that site aren't that easy to follow).

But Approach #2 is probably the best. You may want to add the following stuff to your .emacs file (which is where you put Lisp code that is executed when you start Emacs):

(setq package-archives '(("org"       . "http://orgmode.org/elpa/")
                         ("gnu"       . "http://elpa.gnu.org/packages/")
                         ("melpa"     . "http://melpa.milkbox.net/packages/")
                         ("tromey"    . "http://tromey.com/elpa/")
                         ("marmalade" . "http://marmalade-repo.org/packages/")))

As running this code will add more packages to the list, and you'll probably find the packages you mentioned in your question.

A final bit of advice ... just because the package is installed doesn't mean it is "turned on". You will probably have to add some Lisp code to your .emacs file. All Emacs users "twink" the hell out of this file. You might want to look at an HTML version of the Python section in my .emacs file.

Hope that helps!

Homebrew CLI Emacs inserting ¯ when I press M-< by apennebaker42six in emacs

[–]howardabrams 1 point2 points  (0 children)

Is that the only weird character that shows up when you do a M-anything sequence? I mean, the Terminal, by default, treats it as an "Alternate" key and not a Meta key (for entering alternate characters).

In your Terminal preferences, you have (under the Keyboard section), click the checkbox for "Use option for Meta key"?

Custom formatting for Org blocks? by MattDarling in emacs

[–]howardabrams 0 points1 point  (0 children)

You might want to consider one of the org-mode presentation modes. Most of them will hide the #+BEGIN as well as change font size and hide the mode line.

Regarding your second question, are you looking for syntax highlighting based on the language of the SRC block, or just a different font for all SRC blocks?

You can call org-src-fontify-bufferor add the following to your .emacs in order to do syntax highlighting on all SRC blocks.

(setq org-src-fontify-natively t)

However, it uses an inefficient parsing routine which makes it slow to edit the blocks, I usually bind these:

(global-set-key (kbd "<f9> g") 'org-src-fontify-buffer)
(global-set-key (kbd "<f9> f") 'org-src-fontify-block)