From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "David J. Biesack" Newsgroups: gmane.emacs.bugs Subject: bug#8498: 23.3; mail-abbrev-next-line expands abbrevs when it should not Date: Thu, 14 Apr 2011 09:30:58 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1302790066 1885 80.91.229.12 (14 Apr 2011 14:07:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 14 Apr 2011 14:07:46 +0000 (UTC) To: 8498@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 14 16:07:38 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QANCr-0001MC-Lz for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Apr 2011 16:07:38 +0200 Original-Received: from localhost ([::1]:52039 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QANCq-0005UM-WC for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Apr 2011 10:07:37 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QANCn-0005UD-C8 for bug-gnu-emacs@gnu.org; Thu, 14 Apr 2011 10:07:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QANCe-0008Sk-IX for bug-gnu-emacs@gnu.org; Thu, 14 Apr 2011 10:07:33 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QANCe-0008SY-FQ for bug-gnu-emacs@gnu.org; Thu, 14 Apr 2011 10:07:24 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QAN7S-0000tO-Eq; Thu, 14 Apr 2011 10:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "David J. Biesack" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Apr 2011 14:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8498 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: Original-Received: via spool by submit@debbugs.gnu.org id=B.13027896883370 (code B ref -1); Thu, 14 Apr 2011 14:02:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Apr 2011 14:01:28 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QAN6t-0000sI-8S for submit@debbugs.gnu.org; Thu, 14 Apr 2011 10:01:28 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QAN6p-0000s6-HC for submit@debbugs.gnu.org; Thu, 14 Apr 2011 10:01:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QAN6i-000790-Rj for submit@debbugs.gnu.org; Thu, 14 Apr 2011 10:01:18 -0400 Original-Received: from lists.gnu.org ([140.186.70.17]:47521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAN6i-00078w-Q7 for submit@debbugs.gnu.org; Thu, 14 Apr 2011 10:01:16 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:41949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAN6d-0004Gr-W5 for bug-gnu-emacs@gnu.org; Thu, 14 Apr 2011 10:01:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QAN6V-00077v-EJ for bug-gnu-emacs@gnu.org; Thu, 14 Apr 2011 10:01:11 -0400 Original-Received: from am1ehsobe003.messaging.microsoft.com ([213.199.154.206]:33342 helo=AM1EHSOBE003.bigfish.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAN6V-00077k-2v for bug-gnu-emacs@gnu.org; Thu, 14 Apr 2011 10:01:03 -0400 Original-Received: from mail83-am1-R.bigfish.com (10.3.201.241) by AM1EHSOBE003.bigfish.com (10.3.204.23) with Microsoft SMTP Server id 14.1.225.8; Thu, 14 Apr 2011 13:30:55 +0000 Original-Received: from mail83-am1 (localhost.localdomain [127.0.0.1]) by mail83-am1-R.bigfish.com (Postfix) with ESMTP id D7FA2A88431 for ; Thu, 14 Apr 2011 13:30:55 +0000 (UTC) X-SpamScore: 3 X-BigFish: S3(z1725nzbb2cK936eK1230O1432Nzz1202hzz8275bh8275dhz2fh2a8h668h839h69ih) X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:mercav04d.na.sas.com; RD:mercav04d.na.sas.com; EFVD:NLI Original-Received: from mail83-am1 (localhost.localdomain [127.0.0.1]) by mail83-am1 (MessageSwitch) id 130278785531911_24766; Thu, 14 Apr 2011 13:30:55 +0000 (UTC) Original-Received: from AM1EHSMHS001.bigfish.com (unknown [10.3.201.241]) by mail83-am1.bigfish.com (Postfix) with ESMTP id 0449215D804D for ; Thu, 14 Apr 2011 13:30:55 +0000 (UTC) Original-Received: from mercav04d.na.sas.com (149.173.6.147) by AM1EHSMHS001.bigfish.com (10.3.207.101) with Microsoft SMTP Server (TLS) id 14.1.225.22; Thu, 14 Apr 2011 13:30:54 +0000 X-TM-IMSS-Message-ID: <04b2a7740000bf08@mercav04d.na.sas.com> Original-Received: from d72933.na.sas.com ([10.40.16.229]) by mercav04d.na.sas.com ([10.36.10.9]) with ESMTP (TREND IMSS SMTP Service 7.1) id 04b2a7740000bf08 ; Thu, 14 Apr 2011 09:30:52 -0400 X-OriginatorOrg: sas.com X-detected-operating-system: by eggs.gnu.org: Windows 2000 SP2+, XP SP1+ (seldom 98) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 14 Apr 2011 10:02:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:45814 Archived-At: In rmail, reply to a message. In my case, the From: line in the *mail to...** buffer is formatted as: From: David.Biesack@example.com (David J. Biesack) (In my case, mail-from-style is 'parens ; user-full-name is "David J. Biesa= ck" ) Position point at the end of the From: line formatted as above. Press C-n which is bound to mail-abbrev-next-line=20 If the text before the close parentheses ("Biesack" in this case) is also a defined mail abbrev (i.e. in my ~/.mailrc file) such as=20 alias biesack David.Biesack@example.com then mail-abbrev-next-line will expand that name, yielding: From: David.Biesack@example.com (David J. David.Biesack@example.com) The following change to the function from mailabbrev.el fixes this, but I'v= e not tested this in all possible scenarios (defun mail-abbrev-next-line (&optional arg) "Expand a mail abbrev before point, then move vertically down ARG lines. This only expands an abbrev (if one is present) if called with point at the end of a line, or on whitespace before the end of a line. In terms of line motion, this behaves like `next-line', which see." (interactive "p") (if (and (looking-at "[ \t]*\n")=20 (> (current-column) 0) (/=3D (char-after (- (point) 1)) ?\)) ) (expand-abbrev)) (setq this-command 'next-line) (with-no-warnings (next-line arg))) This updated function works for example if .mailrc contains=20 alias gnu bug-gnu-emacs@gnu.org and you use mail-abbrev-next-line at the end of the following lines: To: gnu=20 To: David.Biesack@example.com, gnu To: David.Biesack@example.com,gnu To: David.Biesack@example.com;gnu To: David.Biesack@example.com, gnu I did not alter the function to check the current header; i.e. it does not make sense to expand abbrevs if the header is From: . I did note that abbrev expansion does not happen on Subject: and In-Reply-To: header lines but I don't see where that is done. If possible, From: should be added to that list. But the fix is still needed in case a To: or Cc: or Bcc: line uses the paren syntax. Also, message.el contains (if (featurep 'xemacs) (require 'mail-abbrevs) (require 'mailabbrev)) but I did not visit mail-abbrevs to see if it has the same problem; I do not use xemacs thanks In GNU Emacs 23.3.1 (x86_64-unknown-linux-gnu) of 2011-03-28 on djb Windowing system distributor `The X.Org Foundation', version 11.0.10900000 configured using `configure '--with-xpm=3Dno' '--with-jpeg=3Dno' '--with-p= ng=3Dno' '--with-gif=3Dno' '--with-tiff=3Dno'' 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: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: shell-dirtrack-mode: t display-time-mode: t delete-selection-mode: t pc-selection-mode: t show-paren-mode: t iswitchb-mode: t nxhtml-menu-mode: t nxhtml-tag-do-also: t popcmp-group-alternatives: t popcmp-short-help-beside-alts: t mlinks-active-links: t rngalt-minimal-validation-header: t rngalt-display-validation-header: t tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t hs-minor-mode: t Recent input: - c h a r s - C-p C-p C-n M-b M-b C-SPC C-n C-e C-w=20 o r SPC ( e c h a r - a t SPC ( - SPC (=20 p o i n t SPC ) SPC 1 ) M-b M-b M-b M-b=20 C-h f e =3D SPC ( C-e ) =20 q C-h f c h a r - a SPC SPC C-p M-f M-f M-f=20 f e r C-e SPC ; =3D =20 ? ) C-SPC C-M-b w C-e C-/ C-SPC C-/ C-/ C-/ C-SPC C-SPC=20 C-M-b M-w C-e C-j C-y C-b C-e C-p C-b \ C-e ) C-n =20 \ > > _ ) =20 ) ) ) C-p C-p C-p C-p C-e C-n C-e C-n C-SPC C-p C-e=20 C-SPC C-SPC C-M-b C-w C-n C-n C-n C-e C-j C-y ) C-x=20 o C-x k SPC C-p C-p C-p C-x o C-p C-p E C-x=20 o C-x b * m a C-p C-n C-n C-x o C-h f =20 C-f C-f C-f C-f t t E C-x o=20 C-n C-e C-n C-/ C-p C-n C-n C-p C-p C-n C-e C-x p =20 D C-e C-x o C-n SPC SPC SPC SPC SPC SPC SPC SPC SPC=20 SPC SPC SPC SPC SPC SPC SPC q =20 / =20 / C-h f C-e C-n M-m C-f / C-e=20 ) TAB q C-p C-p C-n =20 ) ) C-n TAB C-e E C-x o C-x ,=20 C-n C-p C-p C-n C-n C-p C-h c C-p C-p C-n C-n C-p C-b=20 C-p C-x o =20 M-x r e p o r t - e m SPC=20 Recent messages: Result: 107 (#o153, #x6b, ?k) Result: 41 (#o51, #x29, ?\)) Result: t Back to top level. Auto-saving...done mail-abbrev-next-line C-p runs the command previous-line Load-path shadows: /u/sasdjb/emacs/nxhtml/web-vcs hides /u/sasdjb/emacs/web-vcs /u/sasdjb/emacs/nxhtml/nxhtml-web-vcs hides /u/sasdjb/emacs/nxhtml-web-vcs /u/sasdjb/emacs/indent hides /home/sasdjb/linux/emacs/lisp/indent /u/sasdjb/emacs/whitespace hides /home/sasdjb/linux/emacs/lisp/whitespace /u/sasdjb/emacs/ls-lisp hides /home/sasdjb/linux/emacs/lisp/ls-lisp /u/sasdjb/emacs/bs hides /home/sasdjb/linux/emacs/lisp/bs /u/sasdjb/emacs/xml hides /home/sasdjb/linux/emacs/lisp/xml /u/sasdjb/emacs/uniquify hides /home/sasdjb/linux/emacs/lisp/uniquify /u/sasdjb/emacs/align hides /home/sasdjb/linux/emacs/lisp/align /u/sasdjb/emacs/wdired hides /home/sasdjb/linux/emacs/lisp/wdired /u/sasdjb/emacs/cmuscheme hides /home/sasdjb/linux/emacs/lisp/cmuscheme /u/sasdjb/emacs/autoinsert hides /home/sasdjb/linux/emacs/lisp/autoinsert /u/sasdjb/emacs/ibuffer hides /home/sasdjb/linux/emacs/lisp/ibuffer /u/sasdjb/emacs/url/url-handlers hides /home/sasdjb/linux/emacs/lisp/url/ur= l-handlers /u/sasdjb/emacs/url/url-mailto hides /home/sasdjb/linux/emacs/lisp/url/url-= mailto /u/sasdjb/emacs/url/url-misc hides /home/sasdjb/linux/emacs/lisp/url/url-mi= sc /u/sasdjb/emacs/url/url-file hides /home/sasdjb/linux/emacs/lisp/url/url-fi= le /u/sasdjb/emacs/url/url-cache hides /home/sasdjb/linux/emacs/lisp/url/url-c= ache /u/sasdjb/emacs/url/url-http hides /home/sasdjb/linux/emacs/lisp/url/url-ht= tp /u/sasdjb/emacs/url/url-cid hides /home/sasdjb/linux/emacs/lisp/url/url-cid /u/sasdjb/emacs/url/url-methods hides /home/sasdjb/linux/emacs/lisp/url/url= -methods /u/sasdjb/emacs/url/url-about hides /home/sasdjb/linux/emacs/lisp/url/url-a= bout /u/sasdjb/emacs/url/url-nfs hides /home/sasdjb/linux/emacs/lisp/url/url-nfs /u/sasdjb/emacs/url/url-gw hides /home/sasdjb/linux/emacs/lisp/url/url-gw /u/sasdjb/emacs/url/url-parse hides /home/sasdjb/linux/emacs/lisp/url/url-p= arse /u/sasdjb/emacs/url/url-ftp hides /home/sasdjb/linux/emacs/lisp/url/url-ftp /u/sasdjb/emacs/url/url-ns hides /home/sasdjb/linux/emacs/lisp/url/url-ns /u/sasdjb/emacs/url/url-cookie hides /home/sasdjb/linux/emacs/lisp/url/url-= cookie /u/sasdjb/emacs/url/url-util hides /home/sasdjb/linux/emacs/lisp/url/url-ut= il /u/sasdjb/emacs/url/url-proxy hides /home/sasdjb/linux/emacs/lisp/url/url-p= roxy /u/sasdjb/emacs/url/url-privacy hides /home/sasdjb/linux/emacs/lisp/url/url= -privacy /u/sasdjb/emacs/url/url-ldap hides /home/sasdjb/linux/emacs/lisp/url/url-ld= ap /u/sasdjb/emacs/url/url-auth hides /home/sasdjb/linux/emacs/lisp/url/url-au= th /u/sasdjb/emacs/url/url-dired hides /home/sasdjb/linux/emacs/lisp/url/url-d= ired /u/sasdjb/emacs/url/url-history hides /home/sasdjb/linux/emacs/lisp/url/url= -history /u/sasdjb/emacs/url/url-irc hides /home/sasdjb/linux/emacs/lisp/url/url-irc /u/sasdjb/emacs/url/url-vars hides /home/sasdjb/linux/emacs/lisp/url/url-va= rs /u/sasdjb/emacs/url/url-expand hides /home/sasdjb/linux/emacs/lisp/url/url-= expand /u/sasdjb/emacs/url/url hides /home/sasdjb/linux/emacs/lisp/url/url /u/sasdjb/emacs/url/url-imap hides /home/sasdjb/linux/emacs/lisp/url/url-im= ap /u/sasdjb/emacs/url/url-dav hides /home/sasdjb/linux/emacs/lisp/url/url-dav /u/sasdjb/emacs/url/url-news hides /home/sasdjb/linux/emacs/lisp/url/url-ne= ws /u/sasdjb/emacs/table hides /home/sasdjb/linux/emacs/lisp/textmodes/table /u/sasdjb/emacs/icon hides /home/sasdjb/linux/emacs/lisp/progmodes/icon /u/sasdjb/emacs/hideshow hides /home/sasdjb/linux/emacs/lisp/progmodes/hide= show /u/sasdjb/emacs/cpp hides /home/sasdjb/linux/emacs/lisp/progmodes/cpp /u/sasdjb/emacs/glasses hides /home/sasdjb/linux/emacs/lisp/progmodes/glass= es /u/sasdjb/emacs/xscheme hides /home/sasdjb/linux/emacs/lisp/progmodes/xsche= me /u/sasdjb/emacs/sh-script hides /home/sasdjb/linux/emacs/lisp/progmodes/sh-= script /u/sasdjb/emacs/zone hides /home/sasdjb/linux/emacs/lisp/play/zone /u/sasdjb/emacs/solitaire hides /home/sasdjb/linux/emacs/lisp/play/solitaire /u/sasdjb/emacs/quickurl hides /home/sasdjb/linux/emacs/lisp/net/quickurl /u/sasdjb/emacs/metamail hides /home/sasdjb/linux/emacs/lisp/mail/metamail /u/sasdjb/emacs/elp hides /home/sasdjb/linux/emacs/lisp/emacs-lisp/elp /u/sasdjb/emacs/trace hides /home/sasdjb/linux/emacs/lisp/emacs-lisp/trace /u/sasdjb/emacs/re-builder hides /home/sasdjb/linux/emacs/lisp/emacs-lisp/r= e-builder /u/sasdjb/emacs/eldoc hides /home/sasdjb/linux/emacs/lisp/emacs-lisp/eldoc Features: (shadow emacsbug dired-aux cl-specs parse-time vc-cvs cperl-mode script-mod= e rmailout align ef man ddtags rmailedit dabbrev mailalias gnus-msg gnus-ar= t mm-uu mml2015 epg-config mm-view smime dig gnus-sum nnoo gnus-group gnus-= undo nnmail mail-source gnus-start gnus-spec gnus-int gnus-range gnus-win g= nus gnus-ems mail-extr sort par-align debug edebug rmailsum rect make-mode = ansi-color filemenu skeleton sh-script executable tabify browse-region-as-h= tml bg goto-addr rmail-mode-hooks message-mode-hooks ascii-conversion smtpm= ail mailto ph quoted-printable etach whitespace rmailmm message ecomplete r= fc822 mml mml-sec mailabbrev nnheader gmm-utils mailheader canlock sha1 hex= -util hashcash rmail mail-utils multi-isearch tramp-imap assoc tramp-gw tra= mp-fish tramp-smb tramp-cache tramp-ftp tramp-cmds tramp auth-source passwo= rd-cache format-spec tramp-compat trampver add-hook shell color-themes colo= r-theme edmacro kmacro sendmail reporter color-theme-autoloads time server = gnus-dired my-keys resizing thing mosaic-client edit-server password-keeper= -mode sensitive-mode password-generator ps-ccrypt andersl-java-font-lock de= lsel pc-select complete paren iswitchb msb javadecomp autobrowse last-mod q= uickurl browse-url thingatpt disp-table nxhtml-autostart nxhtml-autoload mo= z cc-cmds majmodpri nxhtml-menu udev-rinari udev-ecb udev flymake-js flymak= e css-color nxhtml-mode html-quote tidy-xhtml ediff-merg ediff-diff ediff-w= ind ediff-help ediff-util ediff-mult ediff-init ediff html-imenu imenu load= hist popcmp xhtml-help mlinks url-expand url-util url-methods html-toc xml = fupd html-pagetoc foldit appmenu-fold appmenu mumamo sgml-mode rngalt rng-n= xml nxml-mode nxml-outln nxml-rap nxml-glyph rng-valid rng-loc rng-uri rng-= parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-util nxml= -enc xmltok desktop cc-engine cc-vars cc-defs help-mode view flyspell ispel= l fold-dwim hideshow html-upl html-site derived url-parse url-vars ourcomme= nts-util uniquify recentf tree-widget org byte-opt warnings org-footnote or= g-src org-list org-faces org-compat org-macs noutline outline ido bookmark = pp apropos grep ffip compile comint ring gimpedit dired regexp-opt cl cl-19= web-vcs bytecomp byte-compile rx mm-decode gnus-util netrc mm-bodies mm-en= code mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mm-util time-= date mail-prsvr cus-edit easymenu cus-start cus-load wid-edit web-autoload = nxhtml-base easy-mmode advice help-fns advice-preload tooltip ediff-hook vc= -hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe= lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldra= g mouse jit-lock font-lock syntax facemenu font-core frame cham georgian ut= f-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese heb= rew greek romanian slovak czech european ethiopic indian cyrillic chinese c= ase-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuf= fer faces cus-face files text-properties overlay md5 base64 format env code= -pages mule custom widget hashtable-print-readable backquote make-network-p= rocess x multi-tty emacs) --=20 David J. Biesack, SAS SAS Campus Dr. Cary, NC 27513 www.sas.com (919) 531-7771