[ESS] Hook for ess-rdired-mode?

Grant Rettke gcr at wisdomandwonder.com
Fri Aug 15 03:07:08 CEST 2014


Good evening,

Just tested this against ESS trunk and Emacs 24.3.1 and R 3.1.1.

This reference http://ergoemacs.org/emacs_manual/elisp/Major-Mode-Conventions.html
explained how to add a major mode hook and that is what I followed.

Felt that over-communicating would be safe here, and if I didn't, then
my apologies just let me know what I should fix.

Kind regards,

gcr

gcr at orion:~/svn/ESS/trunk> svn info
Path: .
Working Copy Root Path: /Users/gcr/svn/ESS/trunk
URL: http://svn.r-project.org/ESS/trunk
Repository Root: http://svn.r-project.org/ESS
Repository UUID: 0bbaf3bd-34e0-0310-bf65-c717079852d4
Revision: 6025
Node Kind: directory
Schedule: normal
Last Changed Author: maechler
Last Changed Rev: 6025
Last Changed Date: 2014-08-13 11:33:53 -0500 (Wed, 13 Aug 2014)

gcr at orion:~/svn/ESS/trunk> svn up
Updating '.':
At revision 6025.
gcr at orion:~/svn/ESS/trunk> diff --version
diff (GNU diffutils) 2.8.1
Copyright (C) 2002 Free Software Foundation, Inc.

This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

Written by Paul Eggert, Mike Haertel, David Hayes,
Richard Stallman, and Len Tower.

gcr at orion:~/svn/ESS/trunk> diff --unified
~/svn/ESS/trunk/lisp/ess-rdired.el ~/tmp/ess-rdired.el
--- /Users/gcr/svn/ESS/trunk/lisp/ess-rdired.el 2014-08-14
19:18:10.000000000 -0500
+++ /Users/gcr/tmp/ess-rdired.el 2014-08-14 19:59:07.000000000 -0500
@@ -160,7 +160,11 @@
   (setq revert-buffer-function 'ess-rdired-revert-buffer)
   (use-local-map ess-rdired-mode-map)
   (setq major-mode 'ess-rdired-mode)
-  (setq mode-name (concat "RDired " ess-local-process-name)))
+  (setq mode-name (concat "RDired " ess-local-process-name))
+  (run-mode-hooks 'ess-rdired-mode-hook))
+
+(defun ess-rdired-mode-hook  nil
+  "Run upon entering `ess-rdired-mode'.")

 (defvar ess-rdired-sort-num nil)        ;silence the compiler.
 ;; but see following defun -- maybe it should be buffer local.
gcr at orion:~/svn/ESS/trunk> diff --unified
~/svn/ESS/trunk/lisp/ess-rdired.el ~/tmp/ess-rdired.el >
~/tmp/ess-rdired-hook.patch


More information about the ESS-help mailing list