From: Herbert Euler <herberteuler@hotmail.com>
To: <emacs-devel@gnu.org>
Subject: Not appropriate message for mismatched parens
Date: Wed, 25 Apr 2007 19:01:23 +0800 [thread overview]
Message-ID: <BAY143-W19CF2F92A7B5CB4F018FC5DA490@phx.gbl> (raw)
[-- 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
next reply other threads:[~2007-04-25 11:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-25 11:01 Herbert Euler [this message]
2007-04-25 11:13 ` Not appropriate message for mismatched parens 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BAY143-W19CF2F92A7B5CB4F018FC5DA490@phx.gbl \
--to=herberteuler@hotmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).