Gnus development mailing list
 help / color / mirror / Atom feed
* [patch] `M-Return' on quoted text failed when not using prefix `>'.
@ 2000-03-18 17:50 Rui Zhu
  0 siblings, 0 replies; 5+ messages in thread
From: Rui Zhu @ 2000-03-18 17:50 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 256 bytes --]

Hi, there,

The problem is I'd like to use `| ' as quote prefix when composing
replies, but `message-newline-and-reformat' always searches `>', so it
fails for reformat the text after inserting 3 `\n'.

This one line patch is against today's CVS version.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch for `message-newline-and-reformat' in message.el --]
[-- Type: text/x-patch, Size: 332 bytes --]

--- message.el.orig	Sat Mar 18 17:59:57 2000
+++ message.el	Sat Mar 18 18:13:16 2000
@@ -1627,7 +1627,7 @@
     (unless (bolp)
       (save-excursion
 	(beginning-of-line)
-	(when (looking-at (concat prefix
+	(when (looking-at (concat prefix "\\|"
 				  supercite-thing))
 	  (setq quoted (match-string 0))))
       (insert "\n"))

[-- Attachment #3: Type: text/plain, Size: 1916 bytes --]


BTW, it is still trouble some, because default `fill-paragraph' seems
not like `| ', `: ', etc.  So I now use a external format filter called
`par', following is glue codes.

;;;------------- External Paragraph Reformatter -----------------------
(defvar my-fill-external-program "par")
(defun my-fill-with-external (&optional formatter)
  "Fill region/paragraph with your favorite external formatter.

Fill the region in the sense of `transient-mark-mode' being `t', but
you don't need to use transient mark mode.  Or fill the paragraph
under the point if no region marked. 

The external formatter can be set using variable
`my-fill-external-program'.  `par' is highly recommended; `fmt' in Gnu
`textutils' is one choice; or others which I don't know but can be
used as a filter from stdin to stdout.

Prefix can be used to specify your external formatter or more command
line options."

  (interactive
   (let ((not-use-default current-prefix-arg))
     (list (if not-use-default
               (read-string "Fill formatter: " 
                            (format "%s " my-fill-external-program))
             my-fill-external-program))))
  (let ((old-is-transient transient-mark-mode)
        (formatter (or formatter my-fill-external-program)))
    (unwind-protect
        (progn
          (setq transient-mark-mode t)
          (unless mark-active
            (mark-paragraph))
          (shell-command-on-region (region-beginning) (region-end) 
                                   formatter nil t nil)
          t)                            ; return `t' for `fill-paragraph'
      (setq transient-mark-mode old-is-transient))))

(add-hook 'message-mode-hook
          #'(lambda ()
              (make-local-variable 'fill-paragraph-function)
              (setq fill-paragraph-function 'my-fill-with-external)))

;; (global-set-key [?\C-c ?q] 'my-fill-with-external)

;;; End here

#\Rui

-- 
Happy Gnusing!

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

end of thread, other threads:[~2000-04-22 15:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87snxodv5o.fsf@.i-did-set--mail-host-address--so-not-shoot-me>
2000-04-20 18:40 ` [patch] `M-Return' on quoted text failed when not using prefix `>' Lars Magne Ingebrigtsen
2000-04-22  0:07   ` Rui Zhu
     [not found]   ` <87aein577h.fsf@.i-did-set--mail-host-address--so-not-shoot-me>
2000-04-22 12:15     ` Lars Magne Ingebrigtsen
2000-04-22 15:09       ` Kai Großjohann
2000-03-18 17:50 Rui Zhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).