Permalink
Browse files

>>> Merge git-branch into trunk

commit 89cda0eaa20338b5e64d6d13438511408c26ff2c
Merge: 96f4864 ac3adf7
Author: Vitalie Spinu <spinuvit@gmail.com>
Date:   Thu May 31 01:22:57 2012 -0700

    Merge pull request #16 from milkypostman/master

    Add an autoload file.

commit 7f2065a22839de11bae6fddf05b1d4cbe8010758
Author: Sam Steingold <sds@gnu.org>
Date:   Sun May 6 02:40:16 2012 -0400

    (noweb-font-lock-fontify-chunk-by-number): Use `syntax-begin-function'
     when available instead of `font-lock-beginning-of-syntax-function'
     (obsolete in Emacs 23.3).

commit d03350c360e169a37378e0fd3bd8a22863bc7713
Author: Sam Steingold <sds@gnu.org>
Date:   Sun May 6 02:37:26 2012 -0400

    Avoid `progn' in `cond' and some other minor code cleanup.

commit 047974e824899059e8d5813a756789f10be9e064
Author: Sam Steingold <sds@gnu.org>
Date:   Sun May 6 02:34:28 2012 -0400

    * lisp/ess-site.el: Do not quote lambda expressions.

git-svn-id: https://svn.r-project.org/ESS/trunk@4886 0bbaf3bd-34e0-0310-bf65-c717079852d4
  • Loading branch information...
1 parent 7f8d9fd commit 265965195ddc256992147e9baf695c7324cd5824 @vspinu vspinu committed May 31, 2012
Showing with 173 additions and 97 deletions.
  1. +76 −0 ess-autoloads.el
  2. +14 −0 lisp/ChangeLog
  3. +6 −16 lisp/ess-r-args.el
  4. +7 −7 lisp/ess-site.el
  5. +70 −74 lisp/noweb-font-lock-mode.el
View
@@ -0,0 +1,76 @@
+;;; ess-autoloads.el --- Emacs Speaks Statistics: statistical programming within Emacs
+
+;; Copyright (C) 2012 Donald E. Curtis
+
+;; Original Author: Donald E. Curtis
+;; Created: March 5, 2012
+;; Maintainers: ESS-core <ESS-core@r-project.org>
+
+;; Keywords: autoload, startup, configuration, package.el
+;; Summary: essential autoloads for ESS
+
+;; This file is part of ESS
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+;;
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to
+;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;;
+;; In short: you may use this code any way you like, as long as you
+;; don't charge money for it, remove this notice, or hold anyone liable
+;; for its results.
+
+;;; Commentary:
+
+;;; This file is just a wrapper so that ESS will be more `package.el'
+;;; friendly. This is just a list of functions that require loading
+;;; of ESS through `ess-site'.
+
+;;; Code:
+
+ ;;*;; Requires and autoloads
+;;;=====================================================
+;;;
+
+(when (boundp 'load-path)
+ (add-to-list 'load-path
+ (file-name-as-directory
+ (expand-file-name
+ "lisp"
+ (file-name-directory load-file-name)))))
+
+(autoload 'R "ess-site" "Call 'R', the 'GNU S' system from the R Foundation.
+Optional prefix (C-u) allows to set command line arguments, such as
+--vsize. This should be OS agnostic.
+If you have certain command line arguments that should always be passed
+to R, put them in the variable `inferior-R-args'." t)
+
+(autoload 'S "ess-site" "Call 'S'." t)
+
+ ; Local variables section
+
+;;; This file is automatically placed in Outline minor mode.
+;;; The file is structured as follows:
+;;; Chapters: ^L ;
+;;; Sections: ;;*;;
+;;; Subsections: ;;;*;;;
+;;; Components: defuns, defvars, defconsts
+;;; Random code beginning with a ;;;;* comment
+
+;;; Local variables:
+;;; mode: emacs-lisp
+;;; mode: outline-minor
+;;; outline-regexp: "\^L\\|\\`;\\|;;\\*\\|;;;\\*\\|(def[cvu]\\|(setq\\|;;;;\\*"
+;;; End:
+
+;;; ess-autoloads.el ends here
+
View
@@ -28,6 +28,13 @@
* ess-rd.el (Rd-mode): set ess-language "S" and ess-dialect "R", so
R may be autostarted, when desired.
+2012-05-06 Sam Steingold <sds@gnu.org>
+
+ * ess-site.el: Do not quote lambda expressions.
+ * noweb-font-lock-mode.el (noweb-font-lock-fontify-chunk-by-number):
+ Use `syntax-begin-function' when available instead of
+ `font-lock-beginning-of-syntax-function' (obsolete in Emacs 23.3).
+ Avoid `progn' in `cond' and some other minor code cleanup.
2012-05-05 Vitalie Spinu <spinuvit@gmail.com>
@@ -46,6 +53,13 @@
(inferior-STA-program-name): program name is "stat" as it should
be (and not "env").
+2012-05-02 Sam Steingold <sds@gnu.org>
+
+ * ess-r-args.el (tooltip-show-at-point): Do not use the assoc
+ package (which is obsoleted by Emacs 24.2 anyway), use let
+ instead, it is cleaner and more reliable.
+
+
2012-04-23 Vitalie Spinu <spinuvit@gmail.com>
* merged Daniel Hackney's changes
View
@@ -303,7 +303,7 @@ ess-r-args-current-function if no argument given."
;; SJE: 2009-01-30 -- this contribution from
;; Erik Iverson <iverson@biostat.wisc.edu>
-(require 'assoc) ;needed for aput, below.
+
(defun ess-tooltip-show-at-point (text xo yo)
"Show a tooltip displaying 'text' at (around) point, xo and yo are x-
and y-offsets for the toolbar from point."
@@ -348,21 +348,11 @@ and y-offsets for the toolbar from point."
(cdr(posn-x-y (posn-at-point)))
frame-top yo))
- ;; this clobbers current tooltip-frame-parameters 'top' and 'left',
- ;; which are not set by default. use push/pop instead of aput/adelete?
- ;; the problem with using aput again is that if top/left were nil, aput'ing
- ;; nil will have no effect.
-
- (aput 'tooltip-frame-parameters 'top my-y-offset)
- (aput 'tooltip-frame-parameters 'left my-x-offset)
-
- (tooltip-show text)
-
- ;; remove parameters so that further tooltip-show calls aren't shown in
- ;; odd place (i.e., wherever point happened to be the last time this was
- ;; called
- (adelete 'tooltip-frame-parameters 'top)
- (adelete 'tooltip-frame-parameters 'left)
+ (let ((tooltip-frame-parameters
+ (cons (cons 'top my-y-offset)
+ (cons (cons 'left my-x-offset)
+ tooltip-frame-parameters))))
+ (tooltip-show text))
))
(provide 'ess-r-args)
View
@@ -576,7 +576,7 @@ sending `inferior-ess-language-start' to S-Plus.")
(when ess-versions-created
;; new-menu will be a list of 3-vectors, of the form:
;; ["R-1.8.1" R-1.8.1 t]
- (let ((new-menu (mapcar '(lambda(x) (vector x (intern x) t))
+ (let ((new-menu (mapcar (lambda(x) (vector x (intern x) t))
ess-versions-created)))
(easy-menu-add-item ess-mode-menu '("Start Process")
(cons "Other" new-menu))))
@@ -680,12 +680,12 @@ sending `inferior-ess-language-start' to S-Plus.")
;;; by setting ess-directory to nil, i.e.
;; (setq-default ess-directory nil) ; this is the default.
-(if ess-microsoft-p
- (add-hook 'ess-post-run-hook
- '(lambda()
- (if (string= ess-dialect "R")
- (ess-eval-linewise "options(chmhelp = FALSE, help_type = \"text\")"
- nil nil nil 'wait)))))
+(when ess-microsoft-p
+ (add-hook 'ess-post-run-hook
+ (lambda()
+ (when (string= ess-dialect "R")
+ (ess-eval-linewise "options(chmhelp = FALSE, help_type = \"text\")"
+ nil nil nil 'wait)))))
;;; 3.6 Example of formatting changes
@@ -175,64 +175,60 @@ Each chunk is fontified in accordance with its own mode"
(interactive "P")
(if (or noweb-mode noweb-font-lock-mode)
(progn
- ; This bit is tricky: copied almost verbatim from bib-cite-mode.el
- ; It seems to ensure that the variable noweb-font-lock-mode is made
- ; local to this buffer. It then sets noweb-font-lock-mode to `t' if
- ; 1) It was called with a prefix argument greater than 0
- ; or 2) It was called with no argument, and noweb-font-lock-mode is
- ; currently nil
- ; noweb-font-lock-mode is nil if the prefix argument was <= 0 or there
- ; was no prefix argument and noweb-font-lock-mode is currently `t'
+ ;; This bit is tricky: copied almost verbatim from bib-cite-mode.el
+ ;; It seems to ensure that the variable noweb-font-lock-mode is made
+ ;; local to this buffer. It then sets noweb-font-lock-mode to `t' if
+ ;; 1) It was called with a prefix argument greater than 0
+ ;; or 2) It was called with no argument, and noweb-font-lock-mode is
+ ;; currently nil
+ ;; noweb-font-lock-mode is nil if the prefix argument was <= 0 or there
+ ;; was no prefix argument and noweb-font-lock-mode is currently `t'
(set (make-local-variable 'noweb-font-lock-mode)
(if arg
(> (prefix-numeric-value arg) 0)
(not noweb-font-lock-mode)))
;; Now, if noweb-font-lock-mode is true, we want to turn
;; noweb-font-lock-mode on
(cond
- (noweb-font-lock-mode ;Setup the minor-mode
- (progn
- (if (and (boundp 'global-font-lock-mode) global-font-lock-mode)
- (progn
- (mapcar 'noweb-make-variable-permanent-local
- '(font-lock-fontify-buffer-function
- font-lock-unfontify-buffer-function))
- (setq font-lock-fontify-buffer-function 'nwfl-donowt)
- (setq font-lock-unfontify-buffer-function 'nwfl-donowt)))
- (mapcar 'noweb-make-variable-permanent-local
- '(noweb-font-lock-mode
- font-lock-beginning-of-syntax-function
- noweb-use-font-lock-mode
- after-change-functions))
- (setq noweb-font-lock-mode t)
- (if (< emacs-major-version 21) ;; needed for emacs < 21.1 only :
- (make-local-hook 'after-change-functions))
- (add-hook 'after-change-functions
- 'font-lock-after-change-function nil t)
- (add-hook 'noweb-font-lock-mode-hook 'noweb-font-lock-mode-fn)
- (add-hook 'noweb-changed-chunk-hook
- 'noweb-font-lock-fontify-this-chunk)
- (run-hooks 'noweb-font-lock-mode-hook)
- (message "noweb-font-lock mode: use `M-x noweb-font-lock-describe-mode' for more info")))
+ (noweb-font-lock-mode ;Setup the minor-mode
+ (when (and (boundp 'global-font-lock-mode) global-font-lock-mode)
+ (mapcar 'noweb-make-variable-permanent-local
+ '(font-lock-fontify-buffer-function
+ font-lock-unfontify-buffer-function))
+ (setq font-lock-fontify-buffer-function 'nwfl-donowt)
+ (setq font-lock-unfontify-buffer-function 'nwfl-donowt))
+ (mapcar 'noweb-make-variable-permanent-local
+ '(noweb-font-lock-mode
+ font-lock-beginning-of-syntax-function
+ noweb-use-font-lock-mode
+ after-change-functions))
+ (setq noweb-font-lock-mode t)
+ (when (< emacs-major-version 21) ; needed for emacs < 21.1 only :
+ (make-local-hook 'after-change-functions))
+ (add-hook 'after-change-functions
+ 'font-lock-after-change-function nil t)
+ (add-hook 'noweb-font-lock-mode-hook 'noweb-font-lock-mode-fn)
+ (add-hook 'noweb-changed-chunk-hook
+ 'noweb-font-lock-fontify-this-chunk)
+ (run-hooks 'noweb-font-lock-mode-hook)
+ (message "noweb-font-lock mode: use `M-x noweb-font-lock-describe-mode' for more info"))
;; If we didn't do the above, then we want to turn noweb-font-lock-mode
;; off, no matter what (hence the condition `t')
- (t
- (progn
- (if (and (boundp 'global-font-lock-mode) global-font-lock-mode)
- (progn
- ;; (setq font-lock-fontify-buffer-function
- ;; 'font-lock-default-fontify-buffer)
- ;; Get back our unfontify buffer function
- (setq font-lock-unfontify-buffer-function
- 'font-lock-default-unfontify-buffer)))
- (remove-hook 'noweb-font-lock-mode-hook 'noweb-font-lock-mode-fn)
- (remove-hook 'noweb-changed-chunk-hook
- 'noweb-font-lock-fontify-this-chunk)
- (remove-hook 'after-change-functions
- 'font-lock-after-change-function )
- (font-lock-default-unfontify-buffer)
- (setq noweb-use-font-lock-mode nil)
- (message "noweb-font-lock-mode removed")))))
+ (t
+ (when (and (boundp 'global-font-lock-mode) global-font-lock-mode)
+ ;; (setq font-lock-fontify-buffer-function
+ ;; 'font-lock-default-fontify-buffer)
+ ;; Get back our unfontify buffer function
+ (setq font-lock-unfontify-buffer-function
+ 'font-lock-default-unfontify-buffer))
+ (remove-hook 'noweb-font-lock-mode-hook 'noweb-font-lock-mode-fn)
+ (remove-hook 'noweb-changed-chunk-hook
+ 'noweb-font-lock-fontify-this-chunk)
+ (remove-hook 'after-change-functions
+ 'font-lock-after-change-function )
+ (font-lock-default-unfontify-buffer)
+ (setq noweb-use-font-lock-mode nil)
+ (message "noweb-font-lock-mode removed"))))
(message "noweb-font-lock-mode can only be used with noweb-mode")))
(defun noweb-start-of-syntax ()
@@ -245,19 +241,22 @@ Each chunk is fontified in accordance with its own mode"
(save-excursion
(font-lock-set-defaults)
(setq old-beginning-of-syntax font-lock-beginning-of-syntax-function)
- (setq font-lock-beginning-of-syntax-function 'noweb-start-of-syntax)
+ (if (boundp 'syntax-begin-function)
+ (setq syntax-begin-function 'noweb-start-of-syntax)
+ ;; obsolete since Emacs 23.3
+ (setq font-lock-beginning-of-syntax-function 'noweb-start-of-syntax))
(setq font-lock-keywords
- ; (append font-lock-keywords
- ; '(("\\(\\[\\[\\)\\([^]]*\\]*\\)\\(\\]\\]\\|\\$\\)"
- ; (1 noweb-font-lock-brackets-face prepend )
- ; (2 noweb-font-lock-code-quote-face prepend)
- ; (3 noweb-font-lock-brackets-face prepend))
- ; ("^[ \t\n]*\\(<<\\)\\([^>]*\\)\\(>>=?\\)"
- ; (1 noweb-font-lock-brackets-face prepend )
- ; (2 noweb-font-lock-chunk-name-face prepend)
- ; (3 noweb-font-lock-brackets-face prepend))
- ; ("^@[ \t\n]+"
- ; (0 noweb-font-lock-doc-start-face prepend )))))
+ ;; (append font-lock-keywords
+ ;; '(("\\(\\[\\[\\)\\([^]]*\\]*\\)\\(\\]\\]\\|\\$\\)"
+ ;; (1 noweb-font-lock-brackets-face prepend )
+ ;; (2 noweb-font-lock-code-quote-face prepend)
+ ;; (3 noweb-font-lock-brackets-face prepend))
+ ;; ("^[ \t\n]*\\(<<\\)\\([^>]*\\)\\(>>=?\\)"
+ ;; (1 noweb-font-lock-brackets-face prepend )
+ ;; (2 noweb-font-lock-chunk-name-face prepend)
+ ;; (3 noweb-font-lock-brackets-face prepend))
+ ;; ("^@[ \t\n]+"
+ ;; (0 noweb-font-lock-doc-start-face prepend )))))
(append font-lock-keywords
'(("\\(\\[\\[\\)\\([^]]*\\]*\\)\\(\\]\\]\\|\\$\\)"
(1 font-lock-reference-face prepend )
@@ -349,14 +348,13 @@ For other purposes, use noweb-font-lock-fontify-chunks."
(setq chunk-counter start-chunk)
(message "About to do code chunks")
(while (<= chunk-counter end-chunk)
- (if (stringp (car (aref noweb-chunk-vector chunk-counter)))
- (progn
- ;; It's a code chunk: goto it to set the correct code mode, then
- ;; fontify it.
- (message "Fontifying code chunks: chunk %d" chunk-counter)
- (goto-char (cdr (aref noweb-chunk-vector chunk-counter)))
- (noweb-select-mode)
- (noweb-font-lock-fontify-this-chunk)))
+ (when (stringp (car (aref noweb-chunk-vector chunk-counter)))
+ ;; It's a code chunk: goto it to set the correct code mode, then
+ ;; fontify it.
+ (message "Fontifying code chunks: chunk %d" chunk-counter)
+ (goto-char (cdr (aref noweb-chunk-vector chunk-counter)))
+ (noweb-select-mode)
+ (noweb-font-lock-fontify-this-chunk))
(setq chunk-counter (1+ chunk-counter))))
(noweb-select-mode)))
@@ -382,11 +380,9 @@ For other purposes, use noweb-font-lock-fontify-chunks."
(if (and (not noweb-font-lock-mode) noweb-use-font-lock-mode)
(noweb-font-lock-mode ))))
-(if (functionp 'noweb-old-turn-on-font-lock)
- nil
- (progn
- (fset 'noweb-old-turn-on-font-lock (symbol-function 'turn-on-font-lock))
- (fset 'turn-on-font-lock (symbol-function 'nw-turn-on-font-lock))))
+(unless (functionp 'noweb-old-turn-on-font-lock)
+ (fset 'noweb-old-turn-on-font-lock (symbol-function 'turn-on-font-lock))
+ (fset 'turn-on-font-lock (symbol-function 'nw-turn-on-font-lock)))
(provide 'noweb-font-lock-mode)
;; *****

0 comments on commit 2659651

Please sign in to comment.