unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Highlight opening parentheses in show-paren-mode
@ 2004-04-06  3:57 sand
  0 siblings, 0 replies; only message in thread
From: sand @ 2004-04-06  3:57 UTC (permalink / raw)


In GNU Emacs 21.3.1 (i386-pc-linux-gnu, X toolkit)
 of 2003-10-31 on raven, modified by Debian
configured using `configure  i386-linux --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --without-gif --with-x=yes --with-x-toolkit=athena --without-toolkit-scroll-bars'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: nil

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

    When at the beginning of a valid parenthetical expression,
SHOW-PAREN-FUNCTION in "paren.el" does not highlight the opening
parenthesis.  This is inconsistent behavior, since the function *does*
highlight the opening parenthesis for invalid parenthetical
expressions.

    Worse, this behavior displays poorly when the cursor is a bar
(from a frame parameter CURSOR-TYPE of `bar'); we would reasonably
expect those open parentheses to be highlighted, just like ending
parentheses where the bar is immediately after.

    The attached patch removes the test that disables highlighting for
open parentheses.  Alternatively, one could tweak the existing code to
handle bar cursors specially.

Derek Upham
sand@blarg.net

------------------------------ cut here ------------------------------

diff -u /home/sand/paren.el.orig /home/sand/paren.el
--- /home/sand/paren.el.orig	2004-04-04 23:33:00.000000000 -0700
+++ /home/sand/paren.el	2004-04-04 23:47:11.000000000 -0700
@@ -179,25 +179,21 @@
 	  ;;
 	  ;; If matching backwards, highlight the closeparen
 	  ;; before point as well as its matching open.
-	  ;; If matching forward, and the openparen is unbalanced,
-	  ;; highlight the paren at point to indicate misbalance.
-	  ;; Otherwise, turn off any such highlighting.
-	  (if (and (= dir 1) (integerp pos))
-	      (when (and show-paren-overlay-1
-			 (overlay-buffer show-paren-overlay-1))
-		(delete-overlay show-paren-overlay-1))
-	    (let ((from (if (= dir 1)
-			    (point)
-			  (forward-point -1)))
-		  (to (if (= dir 1)
-			  (forward-point 1)
-			(point))))
-	      (if show-paren-overlay-1
-		  (move-overlay show-paren-overlay-1 from to (current-buffer))
-		(setq show-paren-overlay-1 (make-overlay from to)))
-	      ;; Always set the overlay face, since it varies.
-	      (overlay-put show-paren-overlay-1 'priority show-paren-priority)
-	      (overlay-put show-paren-overlay-1 'face face)))
+	  ;; If matching forward, highlight the openparen
+          ;; after point as well as its matching close.
+          (let ((from (if (= dir 1)
+                          (point)
+                        (forward-point -1)))
+                (to (if (= dir 1)
+                        (forward-point 1)
+                      (point))))
+            (if show-paren-overlay-1
+                (move-overlay show-paren-overlay-1 from to (current-buffer))
+              (setq show-paren-overlay-1 (make-overlay from to)))
+            ;; Always set the overlay face, since it varies.
+            (overlay-put show-paren-overlay-1 'priority show-paren-priority)
+            (overlay-put show-paren-overlay-1 'face face))
+
 	  ;;
 	  ;; Turn on highlighting for the matching paren, if found.
 	  ;; If it's an unmatched paren, turn off any such highlighting.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-04-06  3:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-06  3:57 Highlight opening parentheses in show-paren-mode sand

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).