unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: michael.cadilhac@lrde.org (Michaël Cadilhac)
Subject: zap-to-char to more sensitiveness?
Date: Tue, 05 Sep 2006 17:10:05 +0200	[thread overview]
Message-ID: <87r6yqgxiq.fsf@lrde.org> (raw)


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


Isearch has this (good) behavior to be case sensitive if one char of
its input is uppercase.  Couldn't zap-to-char have the same (good)
behavior?


[-- Attachment #1.1.2: simple.patch --]
[-- Type: text/x-patch, Size: 2178 bytes --]

Index: simple.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/simple.el,v
retrieving revision 1.812
diff -c -r1.812 simple.el
*** simple.el	20 Aug 2006 12:16:58 -0000	1.812
--- simple.el	5 Sep 2006 15:06:12 -0000
***************
*** 2809,2823 ****
  
  (defun zap-to-char (arg char)
    "Kill up to and including ARG'th occurrence of CHAR.
! Case is ignored if `case-fold-search' is non-nil in the current buffer.
! Goes backward if ARG is negative; error if CHAR not found."
    (interactive "p\ncZap to char: ")
    (if (char-table-p translation-table-for-input)
        (setq char (or (aref translation-table-for-input char) char)))
!   (kill-region (point) (progn
! 			 (search-forward (char-to-string char) nil nil arg)
! ;			 (goto-char (if (> arg 0) (1- (point)) (1+ (point))))
! 			 (point))))
  
  ;; kill-line and its subroutines.
  
--- 2809,2825 ----
  
  (defun zap-to-char (arg char)
    "Kill up to and including ARG'th occurrence of CHAR.
! Case is ignored if `case-fold-search' is non-nil in the current buffer and
! CHAR is lowercase.  Goes backward if ARG is negative; error if CHAR not found."
    (interactive "p\ncZap to char: ")
    (if (char-table-p translation-table-for-input)
        (setq char (or (aref translation-table-for-input char) char)))
!   (let ((case-fold-search (and case-fold-search
! 			       (not (eq char (upcase char))))))
!     (kill-region (point) (progn
! 			   (search-forward (char-to-string char) nil nil arg)
! ;			   (goto-char (if (> arg 0) (1- (point)) (1+ (point))))
! 			   (point)))))
  
  ;; kill-line and its subroutines.
  
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.9966
diff -c -0 -r1.9966 ChangeLog
*** ChangeLog	27 Aug 2006 07:08:19 -0000	1.9966
--- ChangeLog	5 Sep 2006 15:06:21 -0000
***************
*** 0 ****
--- 1,5 ----
+ 2006-09-05  Michaël Cadilhac  <michael.cadilhac@lrde.org>
+ 
+ 	* simple.el (zap-to-char): Be case sensitive if the character to zap to
+ 	is uppercase.
+ 

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


BTW, why is there a commented line in this code?

TIA

-- 
 |      Michaël `Micha' Cadilhac   |  Would someone please DTRT with this,  |
 |         Epita/LRDE Promo 2007   |        then ACK?                       |
 | http://www.lrde.org/~cadilh_m   |          -- Richard Stallman           |
 `--  -   JID: micha@amessage.be --'                                   -  --'

[-- 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

             reply	other threads:[~2006-09-05 15:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-05 15:10 Michaël Cadilhac [this message]
2006-09-06 19:05 ` zap-to-char to more sensitiveness? Richard Stallman

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=87r6yqgxiq.fsf@lrde.org \
    --to=michael.cadilhac@lrde.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).