~ubuntu-branches/ubuntu/oneiric/gnuplot-mode/oneiric

« back to all changes in this revision

Viewing changes to gnuplot.el

  • Committer: Bazaar Package Importer
  • Author(s): Vincent Fourmond
  • Date: 2011-02-13 01:24:14 UTC
  • Revision ID: james.westby@ubuntu.com-20110213012414-xuoonjyb6s888a3y
Tags: 1:0.6.0-7
* Update to newer location of the homepage
* Switching to 3.0 (quilt)
  - dropping build-dep on dpatch
  - and debian/README.source, now useless
* Switching to dh 7
* Fix links to gnuplot info, thanks to Kevin Ryde <user42@zip.com.au>
  (closes: 602557) -> 901_gnuplot.el.info-look.diff
* Try to apply the suggestion of Kevin Ryde to get rid of the need for
  gnuplot-setup-info-look (closes: 602561) 
  -> 902_automatic_info_look.diff
  (and it seems I even got it right !)

Show diffs side-by-side

added added

removed removed

Lines of Context:
342
342
    (if (fboundp 'defface)
343
343
        nil
344
344
      (defmacro defface (var values doc &rest args)
345
 
        (` (progn
346
 
             (defvar (, var) (quote (, var)))
347
 
             ;; To make colors for your faces you need to set your .Xdefaults
348
 
             ;; or set them up ahead of time in your .emacs file.
349
 
             (make-face (, var))
350
 
             ))))
 
345
        `(progn
 
346
           (defvar ,var (quote ,var))
 
347
           ;; To make colors for your faces you need to set your .Xdefaults
 
348
           ;; or set them up ahead of time in your .emacs file.
 
349
           (make-face , var)
 
350
           )))
351
351
    (if (fboundp 'defcustom)
352
352
        nil
353
353
      (defmacro defcustom (var value doc &rest args)
354
 
        (` (defvar (, var) (, value) (, doc)))))))
 
354
        `(defvar ,var ,value ,doc)))))
355
355
 
356
356
;; (eval-and-compile
357
357
;;   (condition-case ()
1837
1837
  ;;(if (not (fboundp 'hilit-set-mode-patterns))
1838
1838
  (if (featurep 'font-lock)
1839
1839
      (progn
1840
 
        (make-variable-buffer-local 'font-lock-defaults)
1841
1840
        (setq font-lock-defaults '(gnuplot-font-lock-keywords t t))
1842
1841
        (if gnuplot-xemacs-p (turn-on-font-lock))))
1843
1842
  ;;(if (featurep 'kw-compl)
1863
1862
        (process-kill-without-query gnuplot-process nil)
1864
1863
        (save-excursion
1865
1864
          (set-buffer gnuplot-buffer)
1866
 
          (make-local-hook 'kill-buffer-hook)
1867
 
          (add-hook 'kill-buffer-hook 'gnuplot-close-down nil t)
 
1865
          ;; 'local does not automatically make hook buffer-local in XEmacs.
 
1866
          (if (featurep 'xemacs)
 
1867
              (make-local-hook 'kill-buffer-hook))
 
1868
          (add-hook 'kill-buffer-hook 'gnuplot-close-down nil 'local)
1868
1869
          (gnuplot-comint-start-function)
1869
1870
          (make-local-variable 'comint-output-filter-functions)
1870
1871
          (setq comint-output-filter-functions
2052
2053
    (save-excursion
2053
2054
      (save-excursion
2054
2055
        (end-of-line 0)
2055
 
        (if (bobp) ()
2056
 
          (re-search-backward "^[ \t]*." (point-min) "to_limit")
2057
 
          (back-to-indentation)
2058
 
          (setq indent (current-column))
2059
 
          (if (looking-at "s?pl\\(o?\\|\\(ot\\)?\\)[ \t]+.?")
2060
 
              (let ((plus (1- (length (match-string 0)))))
2061
 
                (end-of-line)
2062
 
                (backward-char 1)
2063
 
                (if (looking-at (regexp-quote "\\"))
2064
 
                    (setq indent  (+ plus indent)))))))
 
2056
        (if (bobp) 
 
2057
            (set indent 0)
 
2058
          (beginning-of-line)
 
2059
          (if (looking-at "\\([^ \t\n]*[ \t]+\\).*\\\\$")
 
2060
              (setq indent (length (match-string 1)))
 
2061
            (setq indent 0))
 
2062
          )
 
2063
        )
 
2064
      (beginning-of-line)
2065
2065
      (if (= (current-indentation) indent)
2066
2066
          ()
2067
 
        (beginning-of-line)
2068
2067
        (delete-horizontal-space)
2069
 
        (insert (make-string indent ? ))))
2070
 
    (if (looking-at "[ \t]+$")
2071
 
        (end-of-line))))
 
2068
        (insert (make-string indent ? )))
 
2069
      )
 
2070
    ))
2072
2071
 
2073
2072
;; FWIW, here are all the options which can be negated:
2074
2073
;; (insert (format "%s"
2173
2172
                      '((gnuplot-mode
2174
2173
                         "[a-zA-Z][_a-zA-Z0-9]*" nil
2175
2174
                         (("(gnuplot)Top"           nil "[_a-zA-Z0-9]+")
2176
 
                          ("(gnuplot)Commands"      nil "[_a-zA-Z0-9]+")
2177
 
                          ("(gnuplot)Functions"     nil "[_a-zA-Z0-9]+")
 
2175
                          ("(gnuplot)Command_Index"  nil "[_a-zA-Z0-9]+")
 
2176
                          ("(gnuplot)Function_Index" nil "[_a-zA-Z0-9]+")
 
2177
                          ("(gnuplot)Options_Index"  nil "[_a-zA-Z0-9]+")
2178
2178
                          ("(gnuplot)plot"          nil "[_a-zA-Z0-9]+")
2179
2179
                          ("(gnuplot)set-show"      nil "[_a-zA-Z0-9]+")
2180
2180
                          ("(gnuplot)data-file"     nil "[_a-zA-Z0-9]+")
2181
2181
                          ("(gnuplot)smooth"        nil "[_a-zA-Z0-9]+")
2182
2182
                          ("(gnuplot)style"         nil "[_a-zA-Z0-9]+")
2183
 
                          ("(gnuplot)terminal"      nil "[_a-zA-Z0-9]+")
 
2183
                          ("(gnuplot)Terminal_Index" nil "[_a-zA-Z0-9]+")
2184
2184
                          ;;("(gnuplot)General Index" nil "[_a-zA-Z0-9]+")
2185
2185
                          ) "[_a-zA-Z0-9]+" ))) ))
2186
 
              (t                        ; newer version
2187
 
               (info-lookup-maybe-add-help
2188
 
                :mode 'gnuplot-mode :topic 'symbol
2189
 
                :regexp "[a-zA-Z][_a-zA-Z0-9]*"
2190
 
                :doc-spec '(("(gnuplot)Top"           nil "[_a-zA-Z0-9]+")
2191
 
                            ("(gnuplot)Commands"      nil "[_a-zA-Z0-9]+")
2192
 
                            ("(gnuplot)Functions"     nil "[_a-zA-Z0-9]+")
2193
 
                            ("(gnuplot)plot"          nil "[_a-zA-Z0-9]+")
2194
 
                            ("(gnuplot)set-show"      nil "[_a-zA-Z0-9]+")
2195
 
                            ("(gnuplot)data-file"     nil "[_a-zA-Z0-9]+")
2196
 
                            ("(gnuplot)smooth"        nil "[_a-zA-Z0-9]+")
2197
 
                            ("(gnuplot)style"         nil "[_a-zA-Z0-9]+")
2198
 
                            ("(gnuplot)terminal"      nil "[_a-zA-Z0-9]+")
2199
 
                            ) )))
 
2186
              (t                ; newer version
 
2187
))
2200
2188
        ;; this hook is my best way of working with info-look and
2201
2189
        ;; allowing multiple versions of the gnuplot-info file.
2202
2190
        ;; yes, this is a hassle.
2489
2477
  (use-local-map gnuplot-mode-map)
2490
2478
  (setq major-mode 'gnuplot-mode
2491
2479
        mode-name "Gnuplot")
 
2480
  (eval-after-load "info-look"
 
2481
               '(info-lookup-maybe-add-help
 
2482
                :mode 'gnuplot-mode :topic 'symbol
 
2483
                :regexp "[a-zA-Z][_a-zA-Z0-9]*"
 
2484
                :doc-spec '(("(gnuplot)Top"           nil "[_a-zA-Z0-9]+")
 
2485
                            ("(gnuplot)Command_Index"  nil "[_a-zA-Z0-9]+")
 
2486
                            ("(gnuplot)Function_Index" nil "[_a-zA-Z0-9]+")
 
2487
                            ("(gnuplot)Options_Index"  nil "[_a-zA-Z0-9]+")
 
2488
                            ("(gnuplot)plot"          nil "[_a-zA-Z0-9]+")
 
2489
                            ("(gnuplot)set-show"      nil "[_a-zA-Z0-9]+")
 
2490
                            ("(gnuplot)data-file"     nil "[_a-zA-Z0-9]+")
 
2491
                            ("(gnuplot)smooth"        nil "[_a-zA-Z0-9]+")
 
2492
                            ("(gnuplot)style"         nil "[_a-zA-Z0-9]+")
 
2493
                            ("(gnuplot)Terminal_Index" nil "[_a-zA-Z0-9]+")
 
2494
                            ) ))
2492
2495
  (set (make-local-variable 'comment-start) "# ")
2493
2496
  (set (make-local-variable 'comment-end) "")
2494
2497
  (set (make-local-variable 'comment-column) 32)
2515
2518
  (if gnuplot-xemacs-p                  ; deal with font-lock
2516
2519
      (if (fboundp 'turn-on-font-lock) (turn-on-font-lock))
2517
2520
    (progn
2518
 
      (make-variable-buffer-local 'font-lock-defaults)
2519
2521
      (setq font-lock-defaults '(gnuplot-font-lock-keywords t t))))
2520
2522
;;   (if (and gnuplot-xemacs-p gnuplot-toolbar-display-flag)
2521
2523
;;       (condition-case ()             ; deal with the toolbar