unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Not appropriate message for mismatched parens
@ 2007-04-25 11:01 Herbert Euler
  2007-04-25 11:13 ` Herbert Euler
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Herbert Euler @ 2007-04-25 11:01 UTC (permalink / raw)
  To: emacs-devel


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


The variable `blink-matching-paren-distance' limits searching regionfor blinking matching parens.  However, the error message for the casein which the distance between the opening paren and the closing parenis larger than `blink-matching-paren-distance' is not so veryappropriate.  It says "Mismatched parenthesis", just the same as forthe normal cases.This may be not the truth in some cases.  The truth is possibly theparens _are matched_, but the distance between them exceeds the valueof `blink-matching-paren-distance'.  In such a case, saying"Mismatched parenthesis" could confuse the user.I wrote a patch, please check it:*** simple.el~  Wed Apr 25 18:25:55 2007--- simple.el   Wed Apr 25 18:56:34 2007*************** (defun blink-matching-open ()*** 4483,4491 ****           blinkpos           message-log-max  ; Don't log messages about paren matching.           matching-paren!          open-paren-line-string)        (save-excursion        (save-restriction          (if blink-matching-paren-distance              (narrow-to-region (max (minibuffer-prompt-end)                                     (- (point) blink-matching-paren-distance))--- 4483,4496 ----           blinkpos           message-log-max  ; Don't log messages about paren matching.           matching-paren!          open-paren-line-string!          open-paren-may-be-outside)        (save-excursion        (save-restriction+         (setq open-paren-may-be-outside+               (and blink-matching-paren-distance+                    (< (minibuffer-prompt-end)+                       (- (point) blink-matching-paren-distance))))          (if blink-matching-paren-distance              (narrow-to-region (max (minibuffer-prompt-end)                                     (- (point) blink-matching-paren-distance))*************** (defun blink-matching-open ()*** 4510,4519 ****                     ;; a matching-char info, in which case the two CDRs                     ;; should match.                     (eq matching-paren (cdr (syntax-after (1- oldpos))))))!         (message "Mismatched parentheses"))         ((not blinkpos)          (if (not blink-matching-paren-distance)!             (message "Unmatched parenthesis")))         ((pos-visible-in-window-p blinkpos)          ;; Matching open within window, temporarily move to blinkpos but only          ;; if `blink-matching-paren-on-screen' is non-nil.--- 4515,4530 ----                     ;; a matching-char info, in which case the two CDRs                     ;; should match.                     (eq matching-paren (cdr (syntax-after (1- oldpos))))))!         (if open-paren-may-be-outside!             (message (concat "Open parenthesis is not found in the region "!                              "restricted by `blink-matching-paren-distance'"))!           (message "Mismatched parentheses")))         ((not blinkpos)          (if (not blink-matching-paren-distance)!             (message "Unmatched parenthesis")!           (if open-paren-may-be-outside!               (message (concat "Open parenthesis is not found in the region "!                                "restricted by `blink-matching-parent-distance'")))))         ((pos-visible-in-window-p blinkpos)          ;; Matching open within window, temporarily move to blinkpos but only          ;; if `blink-matching-paren-on-screen' is non-nil.Regards,Guanpeng Xu
_________________________________________________________________
Connect to the next generation of MSN Messenger 
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline

[-- Attachment #1.2: Type: text/html, Size: 7277 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] 6+ messages in thread

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

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-25 11:01 Not appropriate message for mismatched parens Herbert Euler
2007-04-25 11:13 ` Herbert Euler
2007-04-25 11:21   ` Herbert Euler
2007-04-30 22:09     ` Richard Stallman
2007-04-26  0:20 ` Herbert Euler
2007-04-26  3:06 ` Glenn Morris

Code repositories for project(s) associated with this public inbox

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

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 read-only IMAP folder(s) and NNTP newsgroup(s).