POV-Ray : Newsgroups : povray.off-topic : Emacs Server Time
17 Jun 2024 03:22:36 EDT (-0400)
  Emacs (Message 21 to 30 of 349)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Warp
Subject: Re: Emacs
Date: 14 Apr 2009 12:49:01
Message: <49e4be7d@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> Presumably there is a way of making Emacs read the content of a text 
> file, use the various keys on the keyboard to edit that text, and save 
> the result. But hey, Notepad can do that too! So what is it that Emacs 
> does that's so awesom? What can it do that Notepad can't?

  Can notepad automatically color your code? Can it autoindent your code?
Can you perform a search&replace using a regexp? Can you hex-edit a binary
file (with a typical hex editor layout)? Can you convert between DOS and
UNIX newlines?

  Can you configure a key combination to scroll the view one line at a
time while keeping the cursor visually in place, and another key
combination to scroll the view one line at a time while keeping the
cursor in its current line in the text? Can you configure a key combination
to insert a binary file at the cursor position uuencoded?

  Does notepad support versioning (eg. with git or svn)?

  How many operating systems has notepad been ported to?

-- 
                                                          - Warp


Post a reply to this message

From: Mike Raiford
Subject: Re: Emacs
Date: 14 Apr 2009 13:06:49
Message: <49e4c2a9@news.povray.org>
Warp wrote:

>   Btw, saying "I tried emacs once and gave up" is exactly as stupid as
> saying "I tried povray once and gave up".

I had a friend once that said just that, when I suggested POV-Ray.. He 
just wanted to make neat images, not code :)

I don't remember what purpose I wanted to fulfill with emacs, but it was 
hardly a thing of beauty. Probably because it was shoehorned on the 
Windows platform, and I've only been a Windows/DOS user.

I tried it, and I didn't like it.

-- 
~Mike


Post a reply to this message

From: Mueen Nawaz
Subject: Re: Emacs
Date: 14 Apr 2009 13:07:35
Message: <49e4c2d7$1@news.povray.org>
Invisible wrote:
> My God... The Windows native port is a 37 MB download! O_O

	They have a Windows port?

	Emacs is great on UNIX. On other OS's - no idea.

> Not content with merely being a text editor, it also tries to be a
> newsreader, web browser, file manager, calendar, and even a Tetris
> clone. Unfortunately, from the screenshots I've seen, it does none of
> these things very well.

	Know a better newsreader than gnus? Or for that matter, even a mail
reader better than gnus and/or VM?

> Does anybody know what the hell "C-u 10 C-f" is actually supposed to
> mean? What the heck is a "meta key"? Why are cut and past called kill
> and yank? The list of questions goes on and on.

	I believe it means to do C-f many, many times. Don't know for sure as
I'm not (yet) a real emacs user.

	Meta key is a key your keyboard lacks. On many keyboards, Alt works as
a suitable replacement. Barring that, hitting and releasing Esc should
work.

	As for kill and yank, do realize that Emacs is old. I'm not sure cut
and paste was common editor parlance in those days.

> In spite of the hiddeous UI and cryptic controls, I might almost have
> tried Emacs if it wasn't for the huge size of the download. Clearly I'm
> going to have to wait until I get home to try it out - if I bother at
> all...

	My experience with emacs is that the best (and perhaps only) way to
learn it is to go cold turkey on it (or rather, on everything else) for
a while. I _didn't_ do that when I tried learning it years ago, which is
why I never properly learned it (other than the very basics).

	Most of my coding experience was in IDE's. I'm tired of them now. Even
worse is when you want to code in some language that doesn't have an
IDE. My first impulse was to actually learn SciTe. But I then just
figure I may as well go all the way into emacs (especially given that
I'm tired of mutt and gnus or VM may do a better job for me). I dug up
my copy of the Emacs book (O'Reilly) and read through it a few weeks
ago. It's mind boggling, but I have no idea how it compares to SciTe.

	My goal is not to be a casual user, but somewhat of a power user. If I
want to do anything, I should know it well enough to do it if Emacs
provides native capabilities, or to extend it with Lisp.

Step 1: Set my default editor in mutt to be emacs.
Step 2: Try to start using emacs for HTML, Javascript, Python and LaTeX
docs.
Step 3: Switch to gnus and use it for email and these newsgroups.

	No idea when I'll start Step 1.<G>

	

-- 
A drunk man's words are a sober man's thoughts.


                    /\  /\               /\  /
                   /  \/  \ u e e n     /  \/  a w a z
                       >>>>>>mue### [at] nawazorg<<<<<<
                                   anl


Post a reply to this message

From: triple r
Subject: Re: Emacs
Date: 14 Apr 2009 13:30:01
Message: <web.49e4c7d1be8f6db9805d39df0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
>   How many operating systems has notepad been ported to?

It could probably be ported to the Emacs OS.  It wouldn't be the first:

http://billharlan.com/pub/emacs/

 - Ricky


Post a reply to this message

From: nemesis
Subject: Re: Emacs
Date: 14 Apr 2009 13:38:51
Message: <49e4ca2b$1@news.povray.org>
Invisible escreveu:
> My editor of choice is currently SciTE, so let's see how it compares 
> against this checklist...
> 
>> Extensible/Programmable
> 
> Well, not so much. You can reprogram the syntax hilighting to handle 
> some unknown language if it matches a known one closely enough. And you 
> can program it to run external commands for you (e.g., compile my 
> program, run this through LaTeX, open XDVI...)

Emacs is so friggin' extensible/programmable that what once was just a 
handy set of macros for text editing turned out as a software 
application platform far before there were things like Eclipse or 
Mozilla XPCOM.  There are file browsers, newsclients, web browsers, cvs 
clients and whatever funky stuff you can think of has already been 
written for and is running on Emacs.  You may try alt+x, doctor. ;)

>> Ported to many platforms
> 
> SciTE runs on both Windows and Linux, and that's all I need.

Ah, yes, the old and tired it-fits-my-purpose argument.  Aunt Jemima 
pulls it around everytime to show how Notepad is just the same as Emacs 
or vim.

>> Internationalization
> 
> Not important to me.

Yeah, surely not important at all, except perhaps for the 3 billions of 
Indians and Chinese plus another billions of people who don't speak English.

>> Many editing modes
> 
> ...and?

Well, for once it means you may edit Haskell with far more ease than 
with simple syntax highlighting.  If you RTFM for that mode, that is.

>> Self documenting with built in tutorial
>> Detailed and well written manuals
> 
> Nice, but secondary. It's good to know a tool is easy to learn, but the 
> question is whether it's *worth* learning in the first place.

When you finally see the light and understand it's well worth, it's 
there for you and you won't bother to bash yet another open-source 
project for lack of documentation.

>> AFAIK notepad is/has none of the above.
> 
> Agreed. Notepad fails in many, many basic ways. But SciTE is quite nice 
> in general.

Yes, SciTE is a wonderful editor.  Even being a helluva less powerful 
than emacs or vim.

> On the other hand, nobody rants on about how amazing SciTE is, but Emacs 
> is considered the One True Editor. I'm just trying to figure out why - 
> and if it's worth trying to use it.

It's worth learning for no other reason than most open-source language 
implementations out there have at the very least a very handy 
language-mode available for Emacs which quickly turn it into a quite 
featureful customized IDE for said language.  Just name it:  haskell, 
ocaml, Erlang, Oz etc.  And I don't mean just simple syntax highlight -- 
any shitty editor these days get that, except notepad sure. 
Command-completion, integration with the language compiler, debuggers etc.

Then, there are also incredibly powerful and handy general purpose text 
editing features that once you learn to use you'll ask yourself how 
you've lost so many unproductive years of your life in lesser editors. 
Like copy-paste cyclic buffer, keyboard macros for performing repetitive 
tasks, quick jumping between visited points in the text (like automatic 
bookmarks everytime you jump around in the text), sessions, editor 
customized to suit language needs and many others.  SciTE (or kate) 
simply still not there at all.

Couple emacs and vim with exuberant-ctags (an external tool supporting 
many languages) and you turn your text editor into an almost as good IDE 
for handling large projects and many files.

First thing to do either in emacs or vim is to run the interactive 
tutorials.  In about 30 minutes, it'll cover the basics and give you a 
good overall sense of what it is and how to use the powerful tool. 
Then, getting help on specific subjects of current interest.

-- 
a game sig: http://tinyurl.com/d3rxz9


Post a reply to this message

From: nemesis
Subject: Re: Emacs
Date: 14 Apr 2009 13:47:28
Message: <49e4cc30$1@news.povray.org>
scott escreveu:
> Really, I wish MS would ban software that doesn't at least use the 
> standard font, menus, toolbars, dialogs etc.

Emacs and vi were around long before Microsoft began selling DOS.  Their 
standards are as valid in their context as Microsoft's in their 
products.  They won't change their way to do their stuff just because 
there's a new kid in town.  More likely they will thin out and die 
before going that route.

-- 
a game sig: http://tinyurl.com/d3rxz9


Post a reply to this message

From: nemesis
Subject: Re: Emacs
Date: 14 Apr 2009 14:05:03
Message: <49e4d04f$1@news.povray.org>
Invisible escreveu:
> My God... The Windows native port is a 37 MB download! O_O
> 
> *dies*
> 
> I thought SciTE was bad for taking almost 2 MB, but 37 MB for a mere 
> text editor?

That's a problem with someone who thinks a mere text editor should be 
considered featureful if it provides syntax highlighting.  Emacs/vi + 
Unix command-line is pretty much a textual IDE, not mere editor -- the 
size is even light in the face of graphical IDEs.  Plus the editor 
component is far more featureful than most IDE's editing component.

> Not content with merely being a text editor, it also tries to be a 
> newsreader, web browser, file manager, calendar, and even a Tetris 
> clone. Unfortunately, from the screenshots I've seen, it does none of 
> these things very well.

Screenshots don't show functionality.

> (People may complain that SciTE is primitive, but at least it can manage 
> ANTIALIASED TEXT. :-P Emacs just looks like an ancient console app 
> grafted to look superficially like a modern program...)

Emacs/Unix looks ugly and performs like an athlete.  Notepad/Windows 
looks shiny and performs like a snail.  Hey, if you get a Mac you can 
have awesome visuals + Unix featureful command-line apps.  Best of 2 
worlds! :-D

> Does anybody know what the hell "C-u 10 C-f" is actually supposed to 
> mean? What the heck is a "meta key"? Why are cut and past called kill 
> and yank? The list of questions goes on and on.

RTFM?

C-u 10 (do next command 10 times)
C-f (moves the text cursor (f)orward by 1 char)

You'll move your cursor forward by 10 chars.  That's another thing I 
enjoy in more featureful editors:  simple repetition and far better 
units of motion than just char, word, line or page.  Both vim and emacs 
also allow for moving by sentences and paragraphs/blocks of text.  What 
about easy hierachical editing by moving up and down, into and out of 
scope blocks in programming languages?

Hmm, I think I've made my case for these features here before and didn't 
make your mind then, won't be trying it again... you should try to learn 
and actually practice it to see what you was losing all these years 
rather than ask for features and then just rebating and turning such 
features down on such silly arguments as beauty or other non-sense. 
Looks alone don't mean squat for powerful text editing.

-- 
a game sig: http://tinyurl.com/d3rxz9


Post a reply to this message

From: Mike Raiford
Subject: Re: Emacs
Date: 14 Apr 2009 14:19:27
Message: <49e4d3af@news.povray.org>
Invisible wrote:

> Does anybody know what the hell "C-u 10 C-f" is actually supposed to 
> mean? What the heck is a "meta key"? Why are cut and past called kill 
> and yank? The list of questions goes on and on.

which does which? Kill I imagine deletes the text. Yank I guess is 
similar to a copy then delete operation.

I'm sure there's a way to remap keyboard operations.


-- 
~Mike


Post a reply to this message

From: Warp
Subject: Re: Emacs
Date: 14 Apr 2009 14:21:40
Message: <49e4d434@news.povray.org>
Btw, one problem with emacs is that its default configuration is a bit...
foreign to anybody who has used any other (usually Windows) text editors.
Also be default it doesn't have all the useful bells and whistles (such as
code coloring) turned to maximum, which makes it feel more ascetic than it
really is.

  Anyone trying emacs should use a .emacs configuration file like mine
(which I have developed during over 10 years). It makes things a bit easier
especially for the Windows users (with things like selecting text with
shift+cursor movement, copy it with ctrl+insert, paste it shift+insert,
and so on).
  (Some of the stuff has been added by emacs itself.)

  In Windows you can put the .emacs in the C root directory (I don't know
if current emacs supports it somewhere else as well).


;--------------------------------------------------------------------------
;;; This line adds a LOT of stuff. Among other things it adds
;;; shift+cursor movement selection, ctrl-ins copying, shift-ins pasting, etc.
(pc-selection-mode)

;;; Show also column number besides line number:
(column-number-mode t)

;;; Doesn't add new lines at the end of the doc when cursor is there and
;;; cursor down is pressed:
(setq next-line-add-newlines nil)

;;; Don't create backup files:
(setq auto-save-default nil)
;;; Scroll one line at a time, not half-page:
(setq scroll-step 1)
;;; Colors:
(set-background-color "black")
(set-foreground-color "white")
;(set-face-background 'default "black")
;(set-face-foreground 'default "white")
(set-cursor-color "yellow")

;(standard-display-european t)
;(set-input-mode (car (current-input-mode))
;                (nth 1 (current-input-mode))
;                0)
(set-input-mode 't 'nil 'foo)


;;; Fix home, end and delete to work as they should:
(global-set-key '[home] 'beginning-of-line)
(global-set-key '[end] 'end-of-line)
;(global-set-key '[delete] 'delete-char)
;;; Use ctrl-y to kill a line immediately. Much handier than ctrl-k
(global-set-key "\C-y" 'kill-complete-line)
(global-set-key "\C-u" 'yank)
;;; Other key settings:
(global-set-key [(alt x)] 'save-buffers-kill-emacs)
(global-set-key [(alt f3)] 'delete-window)
(global-set-key '[f2] 'save-buffer)
(global-set-key '[f9] 'compile)
(global-set-key '[(control c) (control r)] 'font-lock-fontify-buffer)
(global-set-key "\C-r" 'insert-file)
;;; Fix bacspace to delete characters instead of popping up the help.
;;; To pop up the help, press F1.
;(global-set-key "\C-h" 'delete-backward-char)

;;; Misc settings:
(auto-fill-mode)
(defun kill-complete-line ()
  "Kill the complete line."
  (interactive)
  (beginning-of-line)
  (if (eobp) (error "End of buffer"))
  (let ((beg (point)))
    (forward-line 1)
    (kill-region beg (point))))

(setq font-lock-maximum-decoration t)
(global-font-lock-mode t)


(setq backup-inhibited 't)
;; Options Menu Settings
;; =====================
(cond
 ((and (string-match "XEmacs" emacs-version)
       (boundp 'emacs-major-version)
       (or (and
            (= emacs-major-version 19)
            (>= emacs-minor-version 14))
           (= emacs-major-version 20))
       (fboundp 'load-options-file))
  (load-options-file "/home/warp/.xemacs-options")))
;; ============================
;; End of Options Menu Settings

;;; Misc help functions:
(defun contents-move (dir checkpoint)
  (let ((oldColumn (current-column)))
    (if (not (pos-visible-in-window-p checkpoint))
        ((lambda ()
           (save-excursion
             (goto-char (window-start))
             (forward-line dir)
             (set-window-start (selected-window) (point))))))
    (forward-line dir)
    (move-to-column oldColumn)))

(defun contents-one-down ()
  (interactive)
  (contents-move -1 (point-min)))

(defun contents-one-up ()
  (interactive)
  (contents-move 1 (point-max)))

(defun generic-page-scroll (lines)
  (let ((oldColumn (current-column)))
    (save-excursion
      (goto-char (window-start))
      (forward-line lines)
      (set-window-start (selected-window) (point)))
    (forward-line lines)
    (move-to-column oldColumn)))

(defun page-scroll-up ()
  (interactive)
  (if (not (pos-visible-in-window-p (point-max)))
      (generic-page-scroll (- (1- (window-height)) next-screen-context-lines))
    (goto-char (point-max))))

(defun page-scroll-down ()
  (interactive)
  (if (not (pos-visible-in-window-p (point-min)))
      (generic-page-scroll (- next-screen-context-lines (1- (window-height))))
    (goto-char (point-min))))

(defun contents-one-down-no-cursor-move ()
  (interactive)
  (scroll-down 1))

(defun contents-one-up-no-cursor-move ()
  (interactive)
  (scroll-up 1))

;;; Use ctrl-up and ctrl-down to scroll:
(global-set-key '[(control up)] 'contents-one-down)
(global-set-key '[(control down)] 'contents-one-up)
(global-set-key '[(meta up)] 'contents-one-down-no-cursor-move)
(global-set-key '[(meta down)] 'contents-one-up-no-cursor-move)
;;; Fix page up and page down to work as they should:
(global-set-key '[next] 'page-scroll-up)
(global-set-key '[prior] 'page-scroll-down)

;; POV-Ray related stuff
;; =====================
(autoload 'pov-mode "/home/warp/software/pov-mode.elc" "PoVray scene file mode" t)
(setq auto-mode-alist
      (append '(("\\.pov$" . pov-mode)
                ("\\.inc$" . pov-mode)
                ("\\.mcr$" . pov-mode))
              auto-mode-alist))
(add-hook 'pov-mode-hook 'turn-on-font-lock)


;; PHP related stuff
;; =================
(autoload 'php-mode "/home/warp/software/php-mode.elc" "PHP mode" t)
(setq auto-mode-alist
      (append '(("\\.php$" . php-mode))
              auto-mode-alist))
(add-hook 'php-mode-hook 'turn-on-font-lock)


;; Lua related stuff
;; =================
(autoload 'lua-mode "/home/warp/software/lua-mode.elc" "Lua editing mode." t)
(setq auto-mode-alist (append '(("\\.lua$" . lua-mode)) auto-mode-alist))
(add-hook 'lua-mode-hook 'turn-on-font-lock)


;;; Insert file at the current position uuencoded with ctrl-c-u
(defun insert-file-uuencoded (filename)
  (interactive "fInsert file (uuencoded): ")
  (shell-command (concat "uuenview -u " filename) t)
)

(global-set-key [(control c) (control u)] 'insert-file-uuencoded)

;;; Kill all whitespace chars forward from cursor with ctrl-t
(defun kill-white-space()
  (interactive)
  (if (re-search-forward "\\(\\s-\\|\n\\)+" nil t)
      (replace-match "")))

(global-set-key '[(control t)] 'kill-white-space)


;Color settings
(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(case-fold-search t)
 '(current-language-environment "Latin-1")
 '(default-input-method "latin-1-prefix")
 '(delete-selection-mode t)
 '(global-font-lock-mode t nil (font-lock))
 '(inhibit-startup-screen t)
 '(lazy-lock-defer-on-the-fly nil)
 '(mode-require-final-newline nil)
 '(require-final-newline nil)
 '(scroll-bar-mode (quote right))
 '(show-trailing-whitespace t)
 '(transient-mark-mode t))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(default ((t (:foreground "white" :background "black"))))
 '(font-lock-builtin-face ((((class color) (background dark)) (:foreground "Green"))))
 '(font-lock-comment-face ((((class color) (background dark)) (:foreground
"ForestGreen"))))
 '(font-lock-constant-face ((((class color) (background dark)) (:foreground
"GreenYellow"))))
 '(font-lock-function-name-face ((((class color) (background dark)) (:foreground
"Coral"))))
 '(font-lock-keyword-face ((((class color) (background dark)) (:foreground
"Yellow"))))
 '(font-lock-string-face ((((class color) (background dark)) (:foreground
"Magenta"))))
 '(font-lock-type-face ((((class color) (background dark)) (:foreground "#40A0FF"))))
 '(font-lock-variable-name-face ((((class color) (background dark)) (:foreground
"thistle"))))
 '(mode-line ((t (:foreground "yellow" :background "Blue"))))
 '(region ((t (:foreground "black" :background "#99CCFF"))))
 '(trailing-whitespace ((((class color) (background dark)) (:background "blue"))))
 '(xxml-emph-1-face ((t (:background "black" :foreground "black" :slant italic))))
 '(xxml-emph-2-face ((t (:stipple nil :background "lightyellow" :foreground "black"
:inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant
normal :weight normal :height 129 :width normal :family "misc-fixed"))))
 '(xxml-header-1-face ((t (:background "seashell1" :foreground "black" :weight
bold))))
 '(xxml-header-2-face ((t (:background "seashell1" :foreground "black" :slant italic
:weight bold))))
 '(xxml-header-3-face ((t (:background "seashell1" :foreground "black" :slant
italic))))
 '(xxml-header-4-face ((t (:stipple nil :background "seashell1" :foreground "black"
:inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant
normal :weight normal :height 129 :width normal :family "misc-fixed"))))
 '(xxml-interaction-face ((t (:stipple nil :background "lightcyan" :foreground "black"
:inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant
normal :weight normal :height 129 :width normal :family "misc-fixed"))))
 '(xxml-rug-face ((t (:stipple nil :background "cyan" :foreground "black"
:inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant
normal :weight normal :height 129 :width normal :family "misc-fixed"))))
 '(xxml-sparkle-face ((t (:stipple nil :background "yellow" :foreground "black"
:inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant
normal :weight normal :height 129 :width normal :family "misc-fixed")))))


;;; C indentation settings
(defun oma-c-mode-common-hook ()
  (interactive)
  (setq c-basic-offset 4)
  (c-set-offset 'substatement-open 0)
  (c-set-offset 'case-label 2)
  (c-set-offset 'block-open 0)
  (c-set-offset 'brace-list-open 0)
  (c-set-offset 'knr-argdecl-intro '-)
  (c-set-offset 'arglist-close 'c-lineup-arglist)
  (c-set-offset 'access-label -3)
  (c-set-offset 'inclass 4)	
  (c-set-offset 'inline-open 0)
  (setq tab-width 8
        ;; this will make sure spaces are used instead of tabs
        indent-tabs-mode nil)
)
(add-hook 'c-mode-common-hook 'oma-c-mode-common-hook)

;(require 'tex-site)
;(require 'TVT-c-style "~/project/tvt/Style/Emacs/tyyli.el")

(tool-bar-mode)
(set-default-font "10x20")
;--------------------------------------------------------------------------


Post a reply to this message

From: somebody
Subject: Re: Emacs
Date: 14 Apr 2009 14:22:16
Message: <49e4d458$1@news.povray.org>
"Invisible" <voi### [at] devnull> wrote in message
news:49e46838$1@news.povray.org...

> OK, so somebody had to ask...

Not really.

> What is it, exactly, that makes Emacs so fantastic? What does it
> actually *do* beyond being a text editor?

Lots. But its household name is historical, goes back to the dark ages of
computing. There are dozens of quite decent free text editors nowadays (see
http://en.wikipedia.org/wiki/List_of_text_editors ).


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.