Archive

Posts Tagged ‘emacs’

emacs commenting lines

July 1st, 2011 No comments

I was wondering if the comment-dwin (M-;) command could be changed that if i am anywhere in the line the whole line is commented and not a comment started from the end of the line. based on the idea found in a mailing list i altered the command with

;; http://www.opensubscriber.com/message/emacs-devel@gnu.org/10971693.html
(defun comment-dwim-line (&optional arg)
  (interactive "*P")
  (comment-normalize-vars)
  (if (and (not (region-active-p)) (not (looking-at "[ \t]*$")))
      (comment-or-uncomment-region (line-beginning-position) (line-end-position))
    (comment-dwim arg)))
 
(global-set-key "\M-;" 'comment-dwim-line)

add this to your .emacs file and enjoy.

Categories: IT
Tags: , ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Install Emacs from source on MAC OS X

April 29th, 2011 1 comment

How to install Emacs from source?

You will need Xcode tools to perform this operation.

MacBook-Pro: mkdir src
MacBook-Pro: cd src
MacBook-Pro: cvs -z3 -d:pserver:anonymous@cvs.sv.gnu.org:/sources/emacs co emacs
MacBook-Pro: cd emacs
MacBook-Pro: ./configure --with-ns --with-jpeg=no --with-gif=no --with-tiff=no
MacBook-Pro: make bootstrap
MacBook-Pro: make
MacBook-Pro: make install
MacBook-Pro: sudo cp -r nextstep/Emacs.app /Applications/Emacs.app

if you would like to use it in terminal

MacBook-Pro: cd src
MacBook-Pro: make
MacBook-Pro: cp emacs /usr/bin/emacs
MacBook-Pro: emacs --version
GNU Emacs 23.1.90.1
Copyright (C) 2009 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
MacBook-Pro: emacs -nw
Categories: MAC OS X
Tags: , ,
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...