From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sebastian Wiesner Newsgroups: gmane.emacs.devel Subject: Re: Mark custom function for interactive use only Date: Mon, 25 Nov 2013 16:42:30 +0100 Message-ID: <3F18D207-3DA2-4003-B995-A8867E8F0140@gmail.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_2E1DEF07-9D68-4286-A1CA-1490055ACB80" X-Trace: ger.gmane.org 1385394180 14989 80.91.229.3 (25 Nov 2013 15:43:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Nov 2013 15:43:00 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 25 16:43:02 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VkyJR-0005oi-MR for ged-emacs-devel@m.gmane.org; Mon, 25 Nov 2013 16:43:01 +0100 Original-Received: from localhost ([::1]:53387 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkyJR-0000zX-CD for ged-emacs-devel@m.gmane.org; Mon, 25 Nov 2013 10:43:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkyJG-0000zH-Fl for emacs-devel@gnu.org; Mon, 25 Nov 2013 10:42:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VkyJ8-0004gT-3I for emacs-devel@gnu.org; Mon, 25 Nov 2013 10:42:50 -0500 Original-Received: from mail-ea0-x22e.google.com ([2a00:1450:4013:c01::22e]:34496) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkyJ7-0004gL-OK for emacs-devel@gnu.org; Mon, 25 Nov 2013 10:42:42 -0500 Original-Received: by mail-ea0-f174.google.com with SMTP id b10so2483163eae.19 for ; Mon, 25 Nov 2013 07:42:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=7WNZOGtSZ66qoMd+AGDpmgJNiWvQ5RwsgGjAmbSF9HI=; b=eaMznf3AF4XOWcF1iVPVZBC8hDyzE21hHnpAt/UtJ815S98hZm9Bmfy57bJxiWrdcy 2mQUkN/+JzK0DjomLqJEyi2BdT65Mos5Ju2I5ipi66zNCfa0X6LoH5M0/zbpkTPaL3tp 12kwbuH5ZM47Xsni5OXQZmnlmBVbEEn3718kNBaSKJ+hxaCzItKUHFIHVfMIwILgrt4o CrCZ5Vn8CxeOHbB6WiuFpND6ywcNwzdu5N9NB5h9VlCxoq8OFakU5w/joEC1TFEunYbF KfdONTIGUQEPKbiADiH1ehk5qCQ2y3043w9ExjITKO0a78NQC7/UIl5g/Z0mY0VUc9Al Telg== X-Received: by 10.14.9.68 with SMTP id 44mr91573ees.105.1385394160556; Mon, 25 Nov 2013 07:42:40 -0800 (PST) Original-Received: from lunaryorn-air.fritz.box (mnch-d9bde14d.pool.mediaWays.net. [217.189.225.77]) by mx.google.com with ESMTPSA id k7sm62428eeg.13.2013.11.25.07.42.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Nov 2013 07:42:39 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.1822) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:165703 Archived-At: --Apple-Mail=_2E1DEF07-9D68-4286-A1CA-1490055ACB80 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii >> +(put 'comint-run 'interactive-only t) > > The non-interactive replacement is `make-comint'. > >> +(put 'delete-backward-char 'interactive-only t) > > Replaced by `delete-char'. > > Looks good, thanks. Updated. --Apple-Mail=_2E1DEF07-9D68-4286-A1CA-1490055ACB80 Content-Disposition: attachment; filename=interactive-only-property.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="interactive-only-property.patch" Content-Transfer-Encoding: quoted-printable =3D=3D=3D=20modified=20file=20'lisp/comint.el'=0A---=20lisp/comint.el=09= 2013-10-29=2016:11:50=20+0000=0A+++=20lisp/comint.el=092013-11-25=20= 15:38:14=20+0000=0A@@=20-752,6=20+752,7=20@@=0A=20=20=20(let=20((name=20= (file-name-nondirectory=20program)))=0A=20=20=20=20=20(switch-to-buffer=20= (make-comint=20name=20program))=0A=20=20=20=20=20(run-hooks=20= (intern-soft=20(concat=20"comint-"=20name=20"-hook")))))=0A+(put=20= 'comint-run=20'interactive-only=20"Use=20`make-comint'=20instead")=0A=20=0A= =20(defun=20comint-exec=20(buffer=20name=20command=20startfile=20= switches)=0A=20=20=20"Start=20up=20a=20process=20named=20NAME=20in=20= buffer=20BUFFER=20for=20Comint=20modes.=0A=0A=3D=3D=3D=20modified=20file=20= 'lisp/emacs-lisp/bytecomp.el'=0A---=20lisp/emacs-lisp/bytecomp.el=09= 2013-10-30=2002:45:53=20+0000=0A+++=20lisp/emacs-lisp/bytecomp.el=09= 2013-11-25=2011:31:48=20+0000=0A@@=20-353,11=20+353,11=20@@=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(t=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(append=20byte-compile-warnings=20= (list=20warning)))))))=0A=20=0A-(defvar=20= byte-compile-interactive-only-functions=0A-=20=20'(beginning-of-buffer=20= end-of-buffer=20replace-string=20replace-regexp=0A-=20=20=20=20= insert-file=20insert-buffer=20insert-file-literally=20previous-line=20= next-line=0A-=20=20=20=20goto-line=20comint-run=20delete-backward-char)=0A= +(defvar=20byte-compile-interactive-only-functions=20nil=20=0A=20=20=20= "List=20of=20commands=20that=20are=20not=20meant=20to=20be=20called=20= from=20Lisp.")=0A+(make-obsolete-variable=20= 'byte-compile-interactive-only-functions=0A+=09=09=09"use=20the=20= `interactive-only'=20symbol=20property=20instead"=0A+=09=09=09"24.4")=0A=20= =0A=20(defvar=20byte-compile-not-obsolete-vars=20nil=0A=20=20=20"List=20= of=20variables=20that=20shouldn't=20be=20reported=20as=20obsolete.")=0A= @@=20-2929,13=20+2929,19=20@@=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (byte-compile-variable-ref=20form))))=0A=20=20=20=20=20=20((symbolp=20= (car=20form))=0A=20=20=20=20=20=20=20(let*=20((fn=20(car=20form))=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20(handler=20(get=20fn=20'byte-compile)))=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20(handler=20(get=20fn=20= 'byte-compile))=0A+=09=20=20=20=20=20(interactive-only=20(or=20(get=20fn=20= 'interactive-only)=0A+=09=09=09=09=20=20=20(memq=20fn=20= byte-compile-interactive-only-functions))))=0A=20=20=20=20=20=20=20=20=20= (when=20(macroexp--const-symbol-p=20fn)=0A=20=20=20=20=20=20=20=20=20=20=20= (byte-compile-warn=20"`%s'=20called=20as=20a=20function"=20fn))=0A-=20=20= =20=20=20=20=20=20(and=20(byte-compile-warning-enabled-p=20= 'interactive-only)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20(memq=20fn=20= byte-compile-interactive-only-functions)=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20(byte-compile-warn=20"`%s'=20used=20from=20Lisp=20code\n\=0A= -That=20command=20is=20designed=20for=20interactive=20use=20only"=20fn))=0A= +=09(when=20(and=20(byte-compile-warning-enabled-p=20'interactive-only)=0A= +=09=09=20=20=20interactive-only)=0A+=09=20=20(byte-compile-warn=20"`%s'=20= used=20from=20Lisp=20code\n\=0A+That=20command=20is=20designed=20for=20= interactive=20use=20only.\n%s"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20fn=0A+=09=09=09=20=20=20=20= =20(if=20(stringp=20interactive-only)=0A+=09=09=09=09=20interactive-only=0A= +=09=09=09=20=20=20=20=20=20=20"Consult=20the=20documentation=20for=20an=20= alternative")))=0A=20=20=20=20=20=20=20=20=20(if=20(and=20(fboundp=20= (car=20form))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (eq=20(car-safe=20(symbol-function=20(car=20form)))=20'macro))=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20(byte-compile-log-warning=0A=0A=3D=3D=3D=20= modified=20file=20'lisp/files.el'=0A---=20lisp/files.el=092013-10-30=20= 02:14:16=20+0000=0A+++=20lisp/files.el=092013-11-25=2010:33:10=20+0000=0A= @@=20-2085,6=20+2085,8=20@@=0A=20\(Its=20calling=20sequence=20is=20= different;=20see=20its=20documentation)."=0A=20=20=20(interactive=20= "*fInsert=20file=20literally:=20")=0A=20=20=20(insert-file-1=20filename=20= #'insert-file-contents-literally))=0A+(put=20'insert-file-literally=20= 'interactive-only=0A+=20=20=20=20=20"Use=20= `insert-file-contents-literally'=20instead")=0A=20=0A=20(defvar=20= find-file-literally=20nil=0A=20=20=20"Non-nil=20if=20this=20buffer=20was=20= made=20by=20`find-file-literally'=20or=20equivalent.=0A@@=20-5007,6=20= +5009,7=20@@=0A=20\(Its=20calling=20sequence=20is=20different;=20see=20= its=20documentation)."=0A=20=20=20(interactive=20"*fInsert=20file:=20")=0A= =20=20=20(insert-file-1=20filename=20#'insert-file-contents))=0A+(put=20= 'insert-file=20'interactive-only=20"Use=20`insert-file-contents'=20= instead.")=0A=20=0A=20(defun=20append-to-file=20(start=20end=20filename)=0A= =20=20=20"Append=20the=20contents=20of=20the=20region=20to=20the=20end=20= of=20file=20FILENAME.=0A=0A=3D=3D=3D=20modified=20file=20= 'lisp/replace.el'=0A---=20lisp/replace.el=092013-11-13=2020:48:35=20= +0000=0A+++=20lisp/replace.el=092013-11-25=2010:31:11=20+0000=0A@@=20= -523,6=20+523,8=20@@=0A=20=09=20=20=20(if=20(and=20transient-mark-mode=20= mark-active)=0A=20=09=20=20=20=20=20=20=20(region-end)))))=0A=20=20=20= (perform-replace=20from-string=20to-string=20nil=20nil=20delimited=20nil=20= nil=20start=20end))=0A+(put=20'replace-string=20'interactive-only=0A+=20=20= =20=20=20"Use=20`search-forward'=20and=20`replace-match'=20instead.")=0A=20= =0A=20(defun=20replace-regexp=20(regexp=20to-string=20&optional=20= delimited=20start=20end)=0A=20=20=20"Replace=20things=20after=20point=20= matching=20REGEXP=20with=20TO-STRING.=0A@@=20-590,6=20+592,8=20@@=0A=20=09= =20=20=20(if=20(and=20transient-mark-mode=20mark-active)=0A=20=09=20=20=20= =20=20=20=20(region-end)))))=0A=20=20=20(perform-replace=20regexp=20= to-string=20nil=20t=20delimited=20nil=20nil=20start=20end))=0A+(put=20= 'replace-regexp=20'interactive-only=0A+=20=20=20=20=20"Use=20= `re-search-forward'=20and=20`replace-match'=20instead.")=0A=20=0A=20=0C=0A= =20(defvar=20regexp-history=20nil=0A=0A=3D=3D=3D=20modified=20file=20= 'lisp/simple.el'=0A---=20lisp/simple.el=092013-10-30=2002:45:53=20+0000=0A= +++=20lisp/simple.el=092013-11-25=2015:38:45=20+0000=0A@@=20-888,6=20= +888,7=20@@=0A=20=09=09=09(/=20(+=2010=20(*=20size=20= (prefix-numeric-value=20arg)))=2010)))=0A=20=09=09=20(point-min))))=0A=20= =20=20(if=20(and=20arg=20(not=20(consp=20arg)))=20(forward-line=201)))=0A= +(put=20'beginning-of-buffer=20'interactive-only=20"Use=20(goto-char=20= (point-min))=20instead")=0A=20=0A=20(defun=20end-of-buffer=20(&optional=20= arg)=0A=20=20=20"Move=20point=20to=20the=20end=20of=20the=20buffer.=0A@@=20= -920,6=20+921,7=20@@=0A=20=09=20;;=20then=20scroll=20specially=20to=20= put=20it=20near,=20but=20not=20at,=20the=20bottom.=0A=20=09=20= (overlay-recenter=20(point))=0A=20=09=20(recenter=20-3))))=0A+(put=20= 'end-of-buffer=20'interactive-only=20"Use=20(goto-char=20(point-max))=20= instead")=0A=20=0A=20(defcustom=20delete-active-region=20t=0A=20=20=20= "Whether=20single-char=20deletion=20commands=20delete=20an=20active=20= region.=0A@@=20-982,6=20+984,7=20@@=0A=20=09=20=20=20=20=20(insert-char=20= ?\s=20(-=20ocol=20(current-column))=20nil))))=0A=20=09;;=20Otherwise,=20= do=20simple=20deletion.=0A=20=09(t=20(delete-char=20(-=20n)=20= killflag))))=0A+(put=20'delete-backward-char=20'interactive-only=20"Use=20= `delete-char'=20instead")=0A=20=0A=20(defun=20delete-forward-char=20(n=20= &optional=20killflag)=0A=20=20=20"Delete=20the=20following=20N=20= characters=20(previous=20if=20N=20is=20negative).=0A@@=20-1079,6=20= +1082,7=20@@=0A=20=20=20=20=20(if=20(eq=20selective-display=20t)=0A=20=09= (re-search-forward=20"[\n\C-m]"=20nil=20'end=20(1-=20line))=0A=20=20=20=20= =20=20=20(forward-line=20(1-=20line)))))=0A+(put=20'goto-line=20= 'interactive-only=20"Use=20`forward-line'=20instead")=0A=20=0A=20(defun=20= count-words-region=20(start=20end=20&optional=20arg)=0A=20=20=20"Count=20= the=20number=20of=20words=20in=20the=20region.=0A@@=20-4165,6=20+4169,7=20= @@=0A=20=20=20=20=20=20(insert-buffer-substring=20(get-buffer=20buffer))=0A= =20=20=20=20=20=20(point)))=0A=20=20=20nil)=0A+(put=20'insert-buffer=20= 'interactive-only=20"Use=20`insert-buffer-substring'=20instead")=0A=20=0A= =20(defun=20append-to-buffer=20(buffer=20start=20end)=0A=20=20=20"Append=20= to=20specified=20buffer=20the=20text=20of=20the=20region.=0A@@=20-4763,6=20= +4768,7=20@@=0A=20=09=20=20=20(signal=20(car=20err)=20(cdr=20err))))=0A=20= =20=20=20=20=20=20(line-move=20arg=20nil=20nil=20try-vscroll)))=0A=20=20=20= nil)=0A+(put=20'next-line=20'interactive-only=20"Use=20`forward-line'=20= instead")=0A=20=0A=20(defun=20previous-line=20(&optional=20arg=20= try-vscroll)=0A=20=20=20"Move=20cursor=20vertically=20up=20ARG=20lines.=0A= @@=20-4802,6=20+4808,8=20@@=0A=20=09=20(signal=20(car=20err)=20(cdr=20= err))))=0A=20=20=20=20=20(line-move=20(-=20arg)=20nil=20nil=20= try-vscroll))=0A=20=20=20nil)=0A+(put=20'previous-line=20= 'interactive-only=0A+=20=20=20=20=20"Use=20`forward-line'=20with=20= negative=20argument=20instead")=0A=20=0A=20(defcustom=20track-eol=20nil=0A= =20=20=20"Non-nil=20means=20vertical=20motion=20starting=20at=20end=20of=20= line=20keeps=20to=20ends=20of=20lines.=0A=0A= --Apple-Mail=_2E1DEF07-9D68-4286-A1CA-1490055ACB80--