[ESS] Care to critique some Emacs-ess slides?

Marc Schwartz marc_schwartz at me.com
Thu Aug 23 17:37:44 CEST 2012


On Aug 23, 2012, at 9:40 AM, Rodney Sparapani <rsparapa at mcw.edu> wrote:

> On 08/22/2012 06:22 PM, Paul Johnson wrote:
>> I told the students they have to use Emacs, and decided to write up
>> slides for that.
>> 
>> http://pj.freefaculty.org/guides/Rcourse/emacs-ess/emacs-ess.pdf
>> 
>> Title "Emacs Has No Learning Curve."
>> 
>> I argue against the general option, which seems to be that Emacs is
>> too difficult and we all need to use RStudio or other IDEs that are
>> designed to run on cell phones.
>> 
>> I think the Emacs tutorial and most Emacs help sheets are causing a
>> problem.  They try to teach people how to use Emacs without a mouse or
>> arrow keys or page down keys. At the current time, It is simply not
>> necessary for many users to remember how to change the active buffer
>> with a keyboard.  The mouse&  menu approach is good enough for most
>> people almost all the time.  If we put a few properly chosen settings
>> in .emacs, Emacs can be just about as convenient as any other editor
>> in the modern desktop world, and it is many times more powerful.
>> 
>> I wonder if this theme is bothersome to you?  If you were learning
>> Emacs today, would you really try to memorize keyboard navigation
>> keys?  Ex: C-v to go to the "next screen" (that's the first thing in
>> Emacs tutorial). I don't think somebody who finished high school after
>> 1990 has even the slightest idea of what "screen" means in a terminal
>> context. Just hit "page down" and forget about it!
>> 
>> If you have ideas for more ESS highlights, please let me know. I think
>> the C-c C-d and C-c C-l trick is the neatest feature ever.  But most
>> of the other ESS stuff is pretty obvious from the GUI layout. I did
>> not write anything about using gdb with C functions inside R packages.
>> If I ever master that, I suppose I'll have to write another slideshow.
>> 
>> pj
>> 
> 
> Hi Paul:
> 
> Very nice!  I agree with quite a lot of what you are saying.  What a
> lot of people don't seem to get is that RStudio is
> just for R.  The great power of emacs is/are modes.  We need to do all
> kinds of things besides R for which there are wonderful modes like
> C/C++, LaTeX, etc.  This is not meant to be a knock on RStudio as I
> really like what they are doing.  I have even more complaints
> about Eclipse and Xcode; they do allow plugins for other
> languages; but, they are really clumsy to use:  for those who have
> a hard time installing ESS try to get one of these other IDEs to
> work with a plugin!
> 
> I want to put this link on the ESS web page.  Is that OK?
> 
> Just a couple of minor comments on the slides...
> Slide 13: Alt = Meta is not a given.
> Slide 16: actually, I think there were function keys around at the
> time that emacs was invented since it started on Dec hardware which
> are famous for their function keys.
> Slide 21: the web page got put together with the last word in the 1st line
> 
> Slide 28:  This is a big digression...
> I have been fond of IBM's Common User Access (CUA) for Cut/Copy/Paste
> which don't conflict with Emacs at all.
> http://en.wikipedia.org/wiki/Common_User_Access#Description
> Copy region: C-Insert
> Cut region:  Sh-Delete
> Paste region: Sh-Insert
> Unfortunately, I don't have a simple prescription for setting these,
> and my reading of the cua-mode documentation doesn't mention them.
> It seems to me that cua-mode is not really CUA at all.  Rather, it
> appears to be mimicking Apple's Human Interface Guidelines
> https://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/KeyboardShortcuts/KeyboardShortcuts.html
> 
> Slide 45: if you hover over the beginning of the modeline, then you
> will see that you can toggle read-only by clicking the 4th character


Hi Paul,

I like what you have done as well.

Some comments on the slides:

1. pc-select mode has been deprecated in Emacs 24 and I believe superseded by shift-select-mode, which works in 23 also. I am not using Emacs 24 yet, due to previously reported issues with ESS and font lock.


2. Not sure if it worth mentioning the use of skeleton-pair mode, which automatically inserts pairs of characters, such as parens, braces, brackets and such. I have the following in my .emacs:

;; =============================================================
;; Set skeleton mode inserting pairs of characters =============
;; =============================================================

;; See http://www.emacswiki.org/emacs/EmacsSpeaksStatistics#toc3
  ;; enable skeleton-pair insert globally
   (setq skeleton-pair t)
   (global-set-key (kbd "(") 'skeleton-pair-insert-maybe)
   (global-set-key (kbd "[") 'skeleton-pair-insert-maybe)
   (global-set-key (kbd "{") 'skeleton-pair-insert-maybe)
   (global-set-key (kbd "\"") 'skeleton-pair-insert-maybe)
   (global-set-key (kbd "\'") 'skeleton-pair-insert-maybe)
   (global-set-key (kbd "\`") 'skeleton-pair-insert-maybe)


3. Would it be worth mentioning that Emacs has builtin support for version control using SVN and Git? Having used SVN for a number of years and now having moved to Git earlier this year, this is very helpful.


4. As with #2 above, would it be worth including the use of the highlight-parentheses package (http://www.emacswiki.org/HighlightParentheses), which enables highlighting nested paren pairs with colors? I have the following in my .emacs:

;; =============================================================
;; Set highlight Parentheses ===================================
;; =============================================================

(load "/MY.PATH.TO/HighlightParenthesis/highlight-parentheses")
(setq hl-paren-colors '("gold" "red" "blue" "green" "orange"))

(defun hpm-on ()
 (highlight-parentheses-mode t))
(add-hook 'ess-mode-hook 'hpm-on)
(add-hook 'inferior-ess-mode-hook 'hpm-on)
(add-hook 'ess-help-mode-hook 'hpm-on)
(add-hook 'tex-mode-hook 'hpm-on)
(add-hook 'text-mode-hook 'hpm-on)
(add-hook 'cperl-mode-hook 'hpm-on)
(add-hook 'Rd-mode-hook 'hpm-on)


5. There is also the windmove package, which is built into Emacs and allows one to define and use M-Cursor keys to quickly move between buffers in the main Emacs frame. I have the following in my .emacs:

;; =============================================================
;; Set keys for 'windmove', built into Emacs  ==================
;; =============================================================

(windmove-default-keybindings 'meta)

(global-set-key (kbd "M-<up>") 'windmove-up)
(global-set-key (kbd "M-<down>") 'windmove-down)
(global-set-key (kbd "M-<right>") 'windmove-right)
(global-set-key (kbd "M-<left>") 'windmove-left)



No doubt there are many approaches to introducing efficiencies into Emacs, which is of course a strength given the programmability of the application. Just thought I would mention a few here.

Thanks,

Marc Schwartz



More information about the ESS-help mailing list