all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Indentation in the METAPOST mode.
@ 2007-08-09  1:00 Michaël Cadilhac
  2007-08-09  7:05 ` Leo
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Michaël Cadilhac @ 2007-08-09  1:00 UTC (permalink / raw)
  To: emacs-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 619 bytes --]

Hi guys, long time no see !

Indentation in the METAPOST mode has, IMO, two major flaws :

1. A bug. If the buffer starts with beginfig, the contents of the figure
is not properly indented (it stays on the first column).

2. When wrapping an expression on several lines, the indentation is the
same for each line, this is bad style : I'd prefer

beginfig(1)
  draw (0,0)--(1,2)--(10,3)--
    (0,1)--(10,3);
  draw (2,2);
endfig

I propose the following patch which considers that keywords like
beginfig does not need ending semicolon (it's /quite/ the case).

Tell me if it's worth installing it.


[-- Attachment #1.1.2: meta-mode.patch --]
[-- Type: text/x-patch, Size: 5488 bytes --]

Index: lisp/progmodes/meta-mode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/meta-mode.el,v
retrieving revision 1.19
diff -c -r1.19 meta-mode.el
*** lisp/progmodes/meta-mode.el	26 Jul 2007 05:27:28 -0000	1.19
--- lisp/progmodes/meta-mode.el	9 Aug 2007 00:51:47 -0000
***************
*** 620,625 ****
--- 620,628 ----
       ((and meta-ignore-comment-regexp
             (looking-at meta-ignore-comment-regexp))
        (current-indentation))
+      ;; Beginning of buffer.
+      ((eq (point-at-bol) (point-min))
+       0)
       ;; Backindent at end of environments.
       ((looking-at
         (concat "\\<" meta-end-environment-regexp "\\>"))
***************
*** 631,661 ****
       (t (meta-indent-calculate-last)))))
  
  (defun meta-indent-calculate-last ()
!   "Return the indentation of previous line of Metafont or MetaPost source."
    (save-restriction
      (widen)
      (skip-chars-backward "\n\t ")
!     (move-to-column (current-indentation))
!     ;; Ignore comments.
!     (while (and (looking-at comment-start) (not (bobp)))
!       (skip-chars-backward "\n\t ")
!       (if (not (bobp))
!           (move-to-column (current-indentation))))
!     (cond
!      ((bobp) 0)
!      (t (+ (current-indentation)
!            (meta-indent-level-count)
!            (cond
!             ;; Compensate for backindent at end of environments.
!             ((looking-at
!               (concat "\\<"meta-end-environment-regexp "\\>"))
!              meta-indent-level)
!             ;; Compensate for backindent within environments.
!             ((looking-at
!               (concat "\\<" meta-within-environment-regexp "\\>"))
!              meta-indent-level)
!             (t 0)))))
!     ))
  
  (defun meta-indent-level-count ()
    "Count indentation change for begin-end commands in the current line."
--- 634,700 ----
       (t (meta-indent-calculate-last)))))
  
  (defun meta-indent-calculate-last ()
!   "Return the indentation of previous line of Metafont or MetaPost source.
! If the current line is a continuation, i.e. the previous line doesn't end
! up with a semicolon, add some more indentation."
    (save-restriction
      (widen)
+     (meta-indent-previous-line)
+     (+ (current-indentation)
+        (meta-indent-level-count)
+        (let ((unfinished (meta-indent-unfinished-line-p)))
+ 	 (cond ((eq unfinished t) meta-indent-level)
+ 	       ((and (not unfinished)
+ 		     (save-excursion
+ 		       (meta-indent-previous-line)
+ 		       (meta-indent-unfinished-line-p)))
+ 		;; Compensate a previous continuation indentation.
+ 		(- meta-indent-level))
+ 	       (t 0)))
+        (cond
+ 	;; Compensate for backindent at end of environments.
+ 	((looking-at
+ 	  (concat "\\<" meta-end-environment-regexp "\\>"))
+ 	 meta-indent-level)
+ 	;; Compensate for backindent within environments.
+ 	((looking-at
+ 	  (concat "\\<" meta-within-environment-regexp "\\>"))
+ 	 meta-indent-level)
+ 	(t 0)))))
+ 
+ (defun meta-indent-previous-line ()
+   "Go to the previous line of code, skipping comments."
+   (skip-chars-backward "\n\t ")
+   (move-to-column (current-indentation))
+   ;; Ignore comments.
+   (while (and (looking-at comment-start) (not (bobp)))
      (skip-chars-backward "\n\t ")
!     (if (not (bobp))
! 	(move-to-column (current-indentation)))))
! 
! (defun meta-indent-unfinished-line-p ()
!   "Tell if the current line of code ends with an unfinished expression.
! Return t if the line is the first line of the unfinished expression.
! Return 'continued if the line is a continuation.
! Return nil if the line is a finished one."
!   (save-excursion
!     (end-of-line)
!     (if (search-backward ";" (point-at-bol) t)
! 	(forward-char)
!       (beginning-of-line))
!     ;; See if the last statement of the line is environment-related,
!     ;; or exists at all.
!     (if (looking-at (concat "[ \t]*\\($\\|" (regexp-quote comment-start)
! 			    "\\|\\<" meta-end-environment-regexp "\\>"
! 			    "\\|\\<" meta-begin-environment-regexp "\\>"
! 			    "\\|\\<" meta-within-environment-regexp "\\>\\)"))
! 	nil
!       (if (or (bobp) (/= (point-at-bol) (point)))
! 	  t
! 	;; Otherwise, if there was no semicolon on the line, see if
! 	;; the previous line was a continuation.
! 	(meta-indent-previous-line)
! 	(if (meta-indent-unfinished-line-p) 'continued t)))))
  
  (defun meta-indent-level-count ()
    "Count indentation change for begin-end commands in the current line."
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.11534
diff -C 0 -r1.11534 ChangeLog
*** lisp/ChangeLog	8 Aug 2007 16:38:31 -0000	1.11534
--- lisp/ChangeLog	9 Aug 2007 00:52:04 -0000
***************
*** 0 ****
--- 1,12 ----
+ 2007-08-09  Michaël Cadilhac  <michael@cadilhac.name>
+ 
+ 	* progmodes/meta-mode.el (meta-indent-calculate): Force
+ 	indentation at bop to 0.
+ 	(meta-indent-previous-line): New.  Go to the previous line of code
+ 	by skipping comments backward.
+ 	(meta-indent-unfinished-line-p): New.  Tell if the current line is
+ 	unfinished, i.e. contains an expression that will be ended in a
+ 	future line.
+ 	(meta-indent-calculate-last): Use it to add some more indentation
+ 	when continuing a line.
+ 

[-- Attachment #1.1.3: Type: text/plain, Size: 327 bytes --]


-- 
 |   Michaël `Micha' Cadilhac       |    Le copillage-collage                |
 |   http://michael.cadilhac.name   |       tue le programmeur.              |
 |   JID/MSN:                       |           -- Dictons LRDE              |
 `----  michael.cadilhac@gmail.com  |                                   -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Indentation in the METAPOST mode.
  2007-08-09  1:00 Indentation in the METAPOST mode Michaël Cadilhac
@ 2007-08-09  7:05 ` Leo
  2007-08-09  9:50 ` Michaël Cadilhac
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Leo @ 2007-08-09  7:05 UTC (permalink / raw)
  To: emacs-devel

On 2007-08-09 02:00 +0100, Michaël Cadilhac wrote:
> Indentation in the METAPOST mode has, IMO, two major flaws :
>
> 1. A bug. If the buffer starts with beginfig, the contents of the figure
> is not properly indented (it stays on the first column).
>
> 2. When wrapping an expression on several lines, the indentation is the
> same for each line, this is bad style : I'd prefer
>
> beginfig(1)
>   draw (0,0)--(1,2)--(10,3)--
>     (0,1)--(10,3);
>   draw (2,2);
> endfig
>
> I propose the following patch which considers that keywords like
> beginfig does not need ending semicolon (it's /quite/ the case).

I haven't used metapost deeply but the proposed change by Michaël is
consistent with examples in:

 http://www.ursoswald.ch/metapost/tutorial.html

HTH,
-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Indentation in the METAPOST mode.
  2007-08-09  1:00 Indentation in the METAPOST mode Michaël Cadilhac
  2007-08-09  7:05 ` Leo
@ 2007-08-09  9:50 ` Michaël Cadilhac
  2007-08-09 13:22 ` Michaël Cadilhac
  2007-08-09 23:11 ` Richard Stallman
  3 siblings, 0 replies; 9+ messages in thread
From: Michaël Cadilhac @ 2007-08-09  9:50 UTC (permalink / raw)
  To: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 1111 bytes --]

michael@cadilhac.name (Michaël Cadilhac) writes:

> Hi guys, long time no see !
>
> Indentation in the METAPOST mode has, IMO, two major flaws :
>
> 1. A bug. If the buffer starts with beginfig, the contents of the figure
> is not properly indented (it stays on the first column).
>
> 2. When wrapping an expression on several lines, the indentation is the
> same for each line, this is bad style : I'd prefer
>
> beginfig(1)
>   draw (0,0)--(1,2)--(10,3)--
>     (0,1)--(10,3);
>   draw (2,2);
> endfig
>
> I propose the following patch which considers that keywords like
> beginfig does not need ending semicolon (it's /quite/ the case).
>
> Tell me if it's worth installing it.

I've spotted some minor problems with this. I'll fix it and get back to
you.

-- 
 |   Michaël `Micha' Cadilhac       |  Un certain Blaise Pascal              |
 |   http://michael.cadilhac.name   |    etc... etc...                       |
 |   JID/MSN:                       |  -- Prévert (Les paris stupides)       |
 `----  michael.cadilhac@gmail.com  |                                   -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Indentation in the METAPOST mode.
  2007-08-09  1:00 Indentation in the METAPOST mode Michaël Cadilhac
  2007-08-09  7:05 ` Leo
  2007-08-09  9:50 ` Michaël Cadilhac
@ 2007-08-09 13:22 ` Michaël Cadilhac
  2007-08-09 23:11 ` Richard Stallman
  3 siblings, 0 replies; 9+ messages in thread
From: Michaël Cadilhac @ 2007-08-09 13:22 UTC (permalink / raw)
  To: emacs-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 1186 bytes --]

michael@cadilhac.name (Michaël Cadilhac) writes:

> Hi guys, long time no see !
>
> Indentation in the METAPOST mode has, IMO, two major flaws :
>
> 1. A bug. If the buffer starts with beginfig, the contents of the figure
> is not properly indented (it stays on the first column).
>
> 2. When wrapping an expression on several lines, the indentation is the
> same for each line, this is bad style : I'd prefer
>
> beginfig(1)
>   draw (0,0)--(1,2)--(10,3)--
>     (0,1)--(10,3);
>   draw (2,2);
> endfig
>
> I propose the following patch which considers that keywords like
> beginfig does not need ending semicolon (it's /quite/ the case).
>
> Tell me if it's worth installing it.

Please consider this extended version. It uses a complete other way to
deal with the indentation which suffers from less flaws. It still has
the following, however, with grouping :

  draw begingraph(3cm,2cm)
      setrange(whatever, 0, whatever, whatever);
    gdraw "data1";
    other-instruction;
  endgraph;

This is not that bad however. I've tested it with the 305 examples of
http://tex.loria.fr/prod-graph/zoonekynd/metapost/metapost.html
with great result.


[-- Attachment #1.1.2: meta-mode.patch --]
[-- Type: text/x-patch, Size: 10227 bytes --]

Index: lisp/progmodes/meta-mode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/meta-mode.el,v
retrieving revision 1.19
diff -c -r1.19 meta-mode.el
*** lisp/progmodes/meta-mode.el	26 Jul 2007 05:27:28 -0000	1.19
--- lisp/progmodes/meta-mode.el	9 Aug 2007 13:13:31 -0000
***************
*** 605,618 ****
  
  (defun meta-indent-calculate ()
    "Return the indentation of current line of Metafont or MetaPost source."
    (save-excursion
      (back-to-indentation)
      (cond
!       ;; Comments to the left margin.
       ((and meta-left-comment-regexp
             (looking-at meta-left-comment-regexp))
        0)
!       ;; Comments to the right margin.
       ((and meta-right-comment-regexp
             (looking-at meta-right-comment-regexp))
        comment-column)
--- 605,620 ----
  
  (defun meta-indent-calculate ()
    "Return the indentation of current line of Metafont or MetaPost source."
+   ;; Indentation within strings is not considered as Meta* don't allow multi
+   ;; line strings.
    (save-excursion
      (back-to-indentation)
      (cond
!      ;; Comments to the left margin.
       ((and meta-left-comment-regexp
             (looking-at meta-left-comment-regexp))
        0)
!      ;; Comments to the right margin.
       ((and meta-right-comment-regexp
             (looking-at meta-right-comment-regexp))
        comment-column)
***************
*** 620,661 ****
       ((and meta-ignore-comment-regexp
             (looking-at meta-ignore-comment-regexp))
        (current-indentation))
       ;; Backindent at end of environments.
!      ((looking-at
         (concat "\\<" meta-end-environment-regexp "\\>"))
!       (- (meta-indent-calculate-last) meta-indent-level))
       ;; Backindent at keywords within environments.
!      ((looking-at
         (concat "\\<" meta-within-environment-regexp "\\>"))
!       (- (meta-indent-calculate-last) meta-indent-level))
!      (t (meta-indent-calculate-last)))))
  
! (defun meta-indent-calculate-last ()
!   "Return the indentation of previous line of Metafont or MetaPost source."
!   (save-restriction
!     (widen)
      (skip-chars-backward "\n\t ")
!     (move-to-column (current-indentation))
!     ;; Ignore comments.
!     (while (and (looking-at comment-start) (not (bobp)))
!       (skip-chars-backward "\n\t ")
!       (if (not (bobp))
!           (move-to-column (current-indentation))))
!     (cond
!      ((bobp) 0)
!      (t (+ (current-indentation)
!            (meta-indent-level-count)
!            (cond
!             ;; Compensate for backindent at end of environments.
!             ((looking-at
!               (concat "\\<"meta-end-environment-regexp "\\>"))
!              meta-indent-level)
!             ;; Compensate for backindent within environments.
!             ((looking-at
!               (concat "\\<" meta-within-environment-regexp "\\>"))
!              meta-indent-level)
!             (t 0)))))
!     ))
  
  (defun meta-indent-level-count ()
    "Count indentation change for begin-end commands in the current line."
--- 622,734 ----
       ((and meta-ignore-comment-regexp
             (looking-at meta-ignore-comment-regexp))
        (current-indentation))
+      ;; Beginning of buffer.
+      ((eq (point-at-bol) (point-min))
+       0)
       ;; Backindent at end of environments.
!      ((meta-indent-looking-at-code
         (concat "\\<" meta-end-environment-regexp "\\>"))
!       (- (meta-indent-current-indentation) meta-indent-level))
       ;; Backindent at keywords within environments.
!      ((meta-indent-looking-at-code
         (concat "\\<" meta-within-environment-regexp "\\>"))
!       (- (meta-indent-current-indentation) meta-indent-level))
!      (t (meta-indent-current-indentation)))))
  
! (defun meta-indent-in-string-p ()
!   "Tell if the point is in a string."
!   (or (nth 3 (syntax-ppss))
!       (eq (get-text-property (point) 'face) font-lock-string-face)))
! 
! (defun meta-indent-looking-at-code (regexp)
!   "Same as `looking-at' but checks that the point is not in a string."
!   (unless (meta-indent-in-string-p)
!     (looking-at regexp)))
! 
! (defun meta-indent-previous-line ()
!   "Go to the previous line of code, skipping comments."
!   (skip-chars-backward "\n\t ")
!   (move-to-column (current-indentation))
!   ;; Ignore comments.
!   (while (and (looking-at comment-start) (not (bobp)))
      (skip-chars-backward "\n\t ")
!     (if (not (bobp))
! 	(move-to-column (current-indentation)))))
! 
! (defun meta-indent-unfinished-line ()
!   "Tell if the current line of code ends with an unfinished expression."
!   (save-excursion
!     (end-of-line)
!     ;; Skip backward the comments.
!     (while (search-backward comment-start (point-at-bol) t))
!     ;; Search for the end of the previous expression.
!     (if (search-backward ";" (point-at-bol) t)
! 	(progn (while (and (meta-indent-in-string-p)
! 			   (search-backward ";" (point-at-bol) t)))
! 	       (if (= (char-after) ?\;)
! 		   (forward-char)
! 		 (beginning-of-line)))
!       (beginning-of-line))
!     ;; See if the last statement of the line is environment-related,
!     ;; or exists at all.
!     (if (meta-indent-looking-at-code
! 	 (concat "[ \t]*\\($\\|" (regexp-quote comment-start)
! 		 "\\|\\<" meta-end-environment-regexp "\\>"
! 		 "\\|\\<" meta-begin-environment-regexp "\\>"
! 		 "\\|\\<" meta-within-environment-regexp "\\>\\)"))
! 	nil
!       t)))
! 
! (defun meta-indent-current-indentation ()
!   "Return the indentation wanted for the current line of code."
!   (+ (meta-indent-current-nesting)
!      (if (save-excursion
! 	   (back-to-indentation)
! 	   (and (not (looking-at (concat "\\<" meta-end-environment-regexp "\\>"
! 					 "\\|\\<" meta-within-environment-regexp "\\>")))
! 		(progn (meta-indent-previous-line)
! 		       (meta-indent-unfinished-line))))
! 	 meta-indent-level
!        0)))
! 
! (defun meta-indent-current-nesting ()
!   "Return the indentation according to the nearest environment keyword."
!   (save-excursion
!     (save-restriction
!       (widen)
!       (back-to-indentation)
!       (let ((to-add 0))
! 	;; If we found some environment marker backward...
! 	(if (catch 'found
! 	      (while (re-search-backward
! 		      (concat "(\\|)\\|\\<" meta-end-environment-regexp "\\>"
! 			      "\\|\\<" meta-begin-environment-regexp "\\>"
! 			      "\\|\\<" meta-within-environment-regexp "\\>")
! 		      nil t)
! 		;; If we aren't in a string or in a comment, we've found something.
! 		(unless (or (meta-indent-in-string-p)
! 			    (nth 4 (syntax-ppss)))
! 		  (cond ((= (char-after) ?\()
! 			 (setq to-add (+ to-add meta-indent-level)))
! 			((= (char-after) ?\))
! 			 (setq to-add (- to-add meta-indent-level)))
! 			(t (throw 'found t))))))
! 	    (progn
! 	      ;; ... then use it to compute the current indentation.
! 	      (back-to-indentation)
! 	      (+ to-add (current-indentation) (meta-indent-level-count)
! 		 ;; Compensate for backindent of end and within keywords.
! 		 (if (meta-indent-looking-at-code
! 		      (concat "\\<" meta-end-environment-regexp "\\>\\|"
! 			      "\\<" meta-within-environment-regexp "\\>"))
! 		     meta-indent-level
! 		   ;; Compensate for unfinished line.
! 		   (if (save-excursion
! 			 (meta-indent-previous-line)
! 			 (meta-indent-unfinished-line))
! 		       (- meta-indent-level)
! 		     0))))
! 	  0)))))
  
  (defun meta-indent-level-count ()
    "Count indentation change for begin-end commands in the current line."
***************
*** 671,688 ****
              (goto-char (match-beginning 0))
              (cond
               ;; Count number of begin-end keywords within line.
!              ((looking-at
                 (concat "\\<" meta-begin-environment-regexp "\\>"))
                (setq count (+ count meta-indent-level)))
!              ((looking-at
                 (concat "\\<" meta-end-environment-regexp "\\>"))
!               (setq count (- count meta-indent-level)))
!              ;; Count number of open-close parentheses within line.
!              ((looking-at "(")
!               (setq count (+ count meta-indent-level)))
!              ((looking-at ")")
!               (setq count (- count meta-indent-level)))
!              )))
          count))))
  
  
--- 744,755 ----
              (goto-char (match-beginning 0))
              (cond
               ;; Count number of begin-end keywords within line.
!              ((meta-indent-looking-at-code
                 (concat "\\<" meta-begin-environment-regexp "\\>"))
                (setq count (+ count meta-indent-level)))
!              ((meta-indent-looking-at-code
                 (concat "\\<" meta-end-environment-regexp "\\>"))
!               (setq count (- count meta-indent-level))))))
          count))))
  
  
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.11534
diff -C 0 -r1.11534 ChangeLog
*** lisp/ChangeLog	8 Aug 2007 16:38:31 -0000	1.11534
--- lisp/ChangeLog	9 Aug 2007 13:13:46 -0000
***************
*** 0 ****
--- 1,18 ----
+ 2007-08-09  Michaël Cadilhac  <michael@cadilhac.name>
+ 
+ 	* progmodes/meta-mode.el (meta-indent-calculate-last): Remove.
+ 	(meta-indent-current-nesting): Use a computation of the nesting
+ 	instead.
+ 	(meta-indent-current-indentation): Indentation is given according
+ 	to nesting and if the previous line was finished or not.
+ 	(meta-indent-unfinished-line): Tell if the current line ends with
+ 	a finished expression.
+ 	(meta-indent-looking-at-code): Like `looking-at', but checks if
+ 	the point is a string before.
+ 	(meta-indent-level-count): Use it.  Don't count parenthesis as it's
+ 	done in the nesting function.
+ 	(meta-indent-in-string-p): Tell if the current point is in a
+ 	string.
+ 	(meta-indent-calculate): Treat b-o-b as a special case.  Use the
+ 	previous functions
+ 

[-- Attachment #1.1.3: Type: text/plain, Size: 327 bytes --]


-- 
 |   Michaël `Micha' Cadilhac       |    The second-degree,                  |
 |   http://michael.cadilhac.name   |       is kind of                       |
 |   JID/MSN:                       |   the semantic back slang.             |
 `----  michael.cadilhac@gmail.com  |                                   -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Indentation in the METAPOST mode.
  2007-08-09  1:00 Indentation in the METAPOST mode Michaël Cadilhac
                   ` (2 preceding siblings ...)
  2007-08-09 13:22 ` Michaël Cadilhac
@ 2007-08-09 23:11 ` Richard Stallman
  2007-09-10 12:49   ` Leo
  2007-09-10 17:11   ` Leo
  3 siblings, 2 replies; 9+ messages in thread
From: Richard Stallman @ 2007-08-09 23:11 UTC (permalink / raw)
  To: Michaël Cadilhac; +Cc: emacs-devel

I expect that few of the people on this list actually use METAPOST
mode.  Please install the best patch you can make, once you've
tested it enough.

And thanks.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Indentation in the METAPOST mode.
  2007-08-09 23:11 ` Richard Stallman
@ 2007-09-10 12:49   ` Leo
  2007-09-10 17:11   ` Leo
  1 sibling, 0 replies; 9+ messages in thread
From: Leo @ 2007-09-10 12:49 UTC (permalink / raw)
  To: emacs-devel

On 2007-08-10 00:11 +0100, Richard Stallman wrote:
> I expect that few of the people on this list actually use METAPOST
> mode.  Please install the best patch you can make, once you've
> tested it enough.
>
> And thanks.

Has Michaël's patch been installed?

There are still problem with indention in metapost-mode. See the
following example, beginfig() has two leading spaces while endfig has
none.

--8<---------------cut here---------------start------------->8---
prologues:=3;
filenametemplate "%j-%c.eps";
  beginfig(1)

endfig;
%%%%
end;
--8<---------------cut here---------------end--------------->8---

This is tested in GNU Emacs 23.0.50.1 (i686-pc-linux-gnu, GTK+ Version
2.10.14, multi-tty) of 2007-09-01.

HTH,
-- 
.:  Leo  :.  [ sdl.web AT gmail.com ]  .:  [ GPG Key: 9283AA3F ]  :.

=>             "(require 'cl) considered harmful" considered harmful
=>           http://dto.freeshell.org/blog/blog-2007-09-07-2323.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Indentation in the METAPOST mode.
  2007-08-09 23:11 ` Richard Stallman
  2007-09-10 12:49   ` Leo
@ 2007-09-10 17:11   ` Leo
  2007-09-10 17:31     ` Michaël Cadilhac
  1 sibling, 1 reply; 9+ messages in thread
From: Leo @ 2007-09-10 17:11 UTC (permalink / raw)
  To: rms; +Cc: Michaël Cadilhac, emacs-devel

Gmane is down. I am re-sending my email.

On 2007-08-10 00:11 +0100, Richard Stallman wrote:
> I expect that few of the people on this list actually use METAPOST
> mode.  Please install the best patch you can make, once you've
> tested it enough.
>
> And thanks.

Has Michaël's patch been installed?

There are still problem with indention in metapost-mode. See the
following example, beginfig() has two leading spaces while endfig has
none.

--8<---------------cut here---------------start------------->8---
prologues:=3;
filenametemplate "%j-%c.eps";
  beginfig(1)

endfig;
%%%%
end;
--8<---------------cut here---------------end--------------->8---

METAPOST: 0.993

This is tested in GNU Emacs 23.0.50.1 (i686-pc-linux-gnu, GTK+ Version
2.10.14, multi-tty) of 2007-09-01.

HTH,
-- 
.:  Leo  :.  [ sdl.web AT gmail.com ]  .:  [ GPG Key: 9283AA3F ]  :.

=>             "(require 'cl) considered harmful" considered harmful
=>           http://dto.freeshell.org/blog/blog-2007-09-07-2323.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Indentation in the METAPOST mode.
  2007-09-10 17:11   ` Leo
@ 2007-09-10 17:31     ` Michaël Cadilhac
  2007-09-10 17:39       ` Leo
  0 siblings, 1 reply; 9+ messages in thread
From: Michaël Cadilhac @ 2007-09-10 17:31 UTC (permalink / raw)
  To: Leo; +Cc: rms, emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 756 bytes --]

Leo <sdl.web@gmail.com> writes:

> There are still problem with indention in metapost-mode. See the
> following example, beginfig() has two leading spaces while endfig has
> none.

> prologues:=3;
> filenametemplate "%j-%c.eps";
>   beginfig(1)
>
> endfig;
> %%%%
> end;

I can't reproduce it, can you try with the latest CVS?  :-) No, just
kidding, I've just installed a change for that.  Thanks for the report!

-- 
 |   Michaël `Micha' Cadilhac       |  Would someone please DTRT with this,  |
 |   http://michael.cadilhac.name   |        then ACK?                       |
 |   JID/MSN:                       |          -- Richard Stallman           |
 `----  michael.cadilhac@gmail.com  |                                   -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Indentation in the METAPOST mode.
  2007-09-10 17:31     ` Michaël Cadilhac
@ 2007-09-10 17:39       ` Leo
  0 siblings, 0 replies; 9+ messages in thread
From: Leo @ 2007-09-10 17:39 UTC (permalink / raw)
  To: Michaël Cadilhac; +Cc: rms, emacs-devel

On 2007-09-10 18:31 +0100, Michaël Cadilhac wrote:
> Leo <sdl.web@gmail.com> writes:
>
>> There are still problem with indention in metapost-mode. See the
>> following example, beginfig() has two leading spaces while endfig has
>> none.
>
>> prologues:=3;
>> filenametemplate "%j-%c.eps";
>>   beginfig(1)
>>
>> endfig;
>> %%%%
>> end;
>
> I can't reproduce it, can you try with the latest CVS?  :-) No, just
> kidding, I've just installed a change for that.  Thanks for the report!

Fixed!!!

-- 
.:  Leo  :.  [ sdl.web AT gmail.com ]  .:  [ GPG Key: 9283AA3F ]  :.

=>             "(require 'cl) considered harmful" considered harmful
=>           http://dto.freeshell.org/blog/blog-2007-09-07-2323.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-09-10 17:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-09  1:00 Indentation in the METAPOST mode Michaël Cadilhac
2007-08-09  7:05 ` Leo
2007-08-09  9:50 ` Michaël Cadilhac
2007-08-09 13:22 ` Michaël Cadilhac
2007-08-09 23:11 ` Richard Stallman
2007-09-10 12:49   ` Leo
2007-09-10 17:11   ` Leo
2007-09-10 17:31     ` Michaël Cadilhac
2007-09-10 17:39       ` Leo

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.