|
From: Elias A. <eli...@gm...> - 2014-03-05 15:03:07
|
Hi,
In gnuplot-mode, ‘gnuplot-send-line-to-gnuplot’ (C-c C-l) helpfully
searches forward to the end of a continued line. However, I thought it
would be even more helpful to also search backward to the beginning of
the logical line.
So below, you will find a version of the function that does that.
HTH,
Elias
PS: My knowledge of Emacs Lisp is very incomplete …
PPS: gnuplot-mode redefines C-m to newline-and-indent. This makes it
awkward to get a newline without any indention. In my experience, most
Emacs modes use C-j for “smart newline” (whatever that may mean in the
mode's context) but leave C-m to mean plain newline.
(defun gnuplot-send-line-to-gnuplot ()
"Sends the current line to the gnuplot program.
Respects continuation lines.
This sets `gnuplot-recently-sent' to 'line."
(interactive)
(cond ((equal major-mode 'gnuplot-mode)
(let (start
end
;(start (save-excursion (beginning-of-line)
(point-marker)))
;(end (save-excursion (beginning-of-line 2) (point-marker)))
)
(save-excursion
(end-of-line 0)
(if (not (looking-at "^$")) (backward-char 1))
(while (looking-at "\\\\") ; go to beginning of first
continued line
(end-of-line 0)
(if (not (looking-at "^$")) (backward-char 1)))
(next-line)
(beginning-of-line)
(setq start (point-marker)))
(save-excursion
(goto-char start)
(end-of-line)
(backward-char 1)
(while (looking-at "\\\\") ; go to end of last continuation line
(end-of-line 2)
(backward-char 1))
(beginning-of-line 2)
(setq end (point-marker)))
(if (not (string-match "\\`\\s-*\\'"
(buffer-substring-no-properties start end)))
(gnuplot-send-region-to-gnuplot start end 'line))
end))
(t
(message "You can only send lines in gnuplot-mode buffers to gnuplot.")
nil)))
|
|
From: Dima K. <gn...@di...> - 2014-03-05 21:18:05
|
Elias Assmann <eli...@gm...> writes: > Hi, > > In gnuplot-mode, ‘gnuplot-send-line-to-gnuplot’ (C-c C-l) helpfully > searches forward to the end of a continued line. However, I thought it > would be even more helpful to also search backward to the beginning of > the logical line. > > So below, you will find a version of the function that does that. > > HTH, > > Elias > > > PS: My knowledge of Emacs Lisp is very incomplete … > > PPS: gnuplot-mode redefines C-m to newline-and-indent. This makes it > awkward to get a newline without any indention. In my experience, most > Emacs modes use C-j for “smart newline” (whatever that may mean in the > mode's context) but leave C-m to mean plain newline. Hi Elias. The gnuplot emacs interface in the gnuplot distribution is out of date. A very updated mode is here: https://github.com/bruceravel/gnuplot-mode You should patch that tree (if it doesn't have your fixes already). Ethan and co: this came up last year, but we didn't do anything about it. Can we either remove the gnuplot emacs mode from the CVS tree (since it's maintained in github already), or make it obvious that the gnuplot.el hosted HERE is a mirror rather than the upstream? dima |
|
From: Ethan A M. <eam...@gm...> - 2014-03-06 05:05:38
|
On Wednesday, 05 March 2014 12:59:17 PM Dima Kogan wrote: > Hi Elias. The gnuplot emacs interface in the gnuplot distribution is out > of date. A very updated mode is here: > > https://github.com/bruceravel/gnuplot-mode > > You should patch that tree (if it doesn't have your fixes already). > > Ethan and co: this came up last year, but we didn't do anything about > it. Can we either remove the gnuplot emacs mode from the CVS tree (since > it's maintained in github already), or make it obvious that the > gnuplot.el hosted HERE is a mirror rather than the upstream? > dima I would be happy to remove it. But I didn't feel comfortable making that decision myself because I am not an emacs user and have no feel for who would be inconvenienced or otherwise unhappy if it disappears. Could you write up a short paragraph for the documentation, the FAQ, and the README explaining what gnuplot-mode is, who might want to use it, and where to find it? thanks, Ethan > Elias Assmann <eli...@gm...> writes: > > > Hi, > > > > In gnuplot-mode, ‘gnuplot-send-line-to-gnuplot’ (C-c C-l) helpfully > > searches forward to the end of a continued line. However, I thought it > > would be even more helpful to also search backward to the beginning of > > the logical line. > > > > So below, you will find a version of the function that does that. > > > > HTH, > > > > Elias > > > > > > PS: My knowledge of Emacs Lisp is very incomplete … > > > > PPS: gnuplot-mode redefines C-m to newline-and-indent. This makes it > > awkward to get a newline without any indention. In my experience, most > > Emacs modes use C-j for “smart newline” (whatever that may mean in the > > mode's context) but leave C-m to mean plain newline. > |
|
From: Dima K. <gn...@di...> - 2014-03-06 05:48:05
|
sfeam <sf...@us...> writes: > On Wednesday, 05 March 2014 12:59:17 PM Dima Kogan wrote: > >> Ethan and co: this came up last year, but we didn't do anything about >> it. Can we either remove the gnuplot emacs mode from the CVS tree (since >> it's maintained in github already), or make it obvious that the >> gnuplot.el hosted HERE is a mirror rather than the upstream? > > I would be happy to remove it. > But I didn't feel comfortable making that decision myself because > I am not an emacs user and have no feel for who would be > inconvenienced or otherwise unhappy if it disappears. > > Could you write up a short paragraph for the documentation, > the FAQ, and the README explaining what gnuplot-mode is, > who might want to use it, and where to find it? Hi Ethan. Here's a description that mostly comes from the source: ================================================================ The emacs gnuplot-mode is a major mode for composing gnuplot scripts and displaying their results using gnuplot. It can be obtained from MELPA or from a distribution such as Debian or Ubuntu. Otherwise, the source lives at https://github.com/bruceravel/gnuplot-mode This mode offers several tools to help you compose your scripts, including font-lock syntax colorization, a syntax table appropriate to gnuplot, key bindings, pull-down menus, indentation, keyword completions and variable customization using the Custom package. Once the script is composed, there are several function for sending some or all of the script to gnuplot. The interaction with the gnuplot process is within a comint buffer. Plots can optionally be displayed within Emacs. ================================================================ In non-emacs-speak, it provides facilities to make writing and running scripts easier. I really do think it should be removed. Not only does emacs have standardized packaging infrastructure that has this package in it, distros such as Debian carry it too. It's a bit of a historical accident that this ever lived in the gnuplot tree, but there's no reason for it at all anymore. If we have a list somewhere of frontends and libraries that use gnuplot, we should mention it there. dima |
|
From: Elias A. <eli...@gm...> - 2014-03-06 10:21:43
|
Hi Dima, On 03/05/2014 09:59 PM, Dima Kogan wrote: > Hi Elias. The gnuplot emacs interface in the gnuplot distribution is out > of date. A very updated mode is here: Way out of date actually! I did not really look at the header. And good catch, I have to say -- I did not say which source I was using. > https://github.com/bruceravel/gnuplot-mode > > You should patch that tree (if it doesn't have your fixes already). In fact, this already has (defun gnuplot-send-line-to-gnuplot () … (save-excursion ;; go to start of continued command, or beginning of line ;; if this is not a continuation of a previous line <JJO> (gnuplot-beginning-of-continuation) … For what it's worth, I agree that it would be better to remove the outdated gnuplot.el from the gnuplot distribution :-). Thank you for pointing me to the new version. Elias |
|
From: Ethan M. <eam...@gm...> - 2014-03-06 17:50:58
|
What about the files gnuplot-eldoc.el and gnuplot-eldoc.elc that are generated from the master documentation file gnuplot.doc? Are they part of gnuplot-mode or are they for something else entirely? On Thu, Mar 6, 2014 at 2:21 AM, Elias Assmann <eli...@gm...>wrote: > Hi Dima, > > On 03/05/2014 09:59 PM, Dima Kogan wrote: > > Hi Elias. The gnuplot emacs interface in the gnuplot distribution is out > > of date. A very updated mode is here: > > Way out of date actually! I did not really look at the header. > > And good catch, I have to say -- I did not say which source I was using. > > > https://github.com/bruceravel/gnuplot-mode > > > > You should patch that tree (if it doesn't have your fixes already). > > In fact, this already has > > (defun gnuplot-send-line-to-gnuplot () > … > (save-excursion > ;; go to start of continued command, or beginning of line > ;; if this is not a continuation of a previous line <JJO> > (gnuplot-beginning-of-continuation) > … > > For what it's worth, I agree that it would be better to remove the > outdated gnuplot.el from the gnuplot distribution :-). > > Thank you for pointing me to the new version. > > Elias > > > > ------------------------------------------------------------------------------ > Subversion Kills Productivity. Get off Subversion & Make the Move to > Perforce. > With Perforce, you get hassle-free workflows. Merge that actually works. > Faster operations. Version large binaries. Built-in WAN optimization and > the > freedom to use Git, Perforce or both. Make the move to Perforce. > > http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > Membership management via: > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > |
|
From: Dima K. <gn...@di...> - 2014-03-06 19:04:15
|
Ethan Merritt <eam...@gm...> writes: > What about the files gnuplot-eldoc.el and gnuplot-eldoc.elc that are > generated from the master documentation file gnuplot.doc? Are they part > of gnuplot-mode or are they for something else entirely? Those aren't a part of gnuplot-mode. The .elc is a byte-compiled version of the .el. gnuplot-eldoc.el looks like it is meant to provide completion when creating gnuplot scripts, but it was never being installed in any meaningful way, so I've never used it (or heard of it for that matter). The newer gnuplot-mode tree provides this functionality in a different way. I'm pretty sure those files could be removed. They were undiscoverable, and are now handled in a more logical (and obvious) place. dima |