From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 17 13:38:48 2012 Received: (at submit) by debbugs.gnu.org; 17 Dec 2012 18:38:48 +0000 Received: from localhost ([127.0.0.1]:47515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkfaO-0007dX-Pm for submit@debbugs.gnu.org; Mon, 17 Dec 2012 13:38:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33778) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tkeoy-0006WR-1T for submit@debbugs.gnu.org; Mon, 17 Dec 2012 12:49:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tkenf-0005KL-Lc for submit@debbugs.gnu.org; Mon, 17 Dec 2012 12:48:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE autolearn=no version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:43011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tkenf-0005KG-IP for submit@debbugs.gnu.org; Mon, 17 Dec 2012 12:48:23 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tkena-000392-Kq for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2012 12:48:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TkenX-0005Iu-29 for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2012 12:48:18 -0500 Received: from [69.90.114.176] (port=43645 helo=samograd.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkenW-0005IA-JS for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2012 12:48:14 -0500 Received: from CDW764-BURTONS.QFTI.COM (localhost.localdomain [127.0.0.1]) by samograd.ca (Postfix) with ESMTP id 2973C52F403A for ; Mon, 17 Dec 2012 10:26:52 -0700 (MST) From: Burton Samograd To: bug-gnu-emacs@gnu.org Subject: 24.2.90; setf (symbol-function ...) does not set buffer local variable if present Date: Mon, 17 Dec 2012 10:26:50 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 17 Dec 2012 13:38:42 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) In *scratch* (make-local-variable 'cons) (setf (symbol-function 'cons) (lambda (x y) (+ x y))) (cons 1 2) 3 Killing *scratch* and creating a new one gives: (cons 1 2) 3 Setf on symbol-function is not setting the buffer local binding of the given variable after is has been made a buffer local variable. In GNU Emacs 24.2.90.1 (i686-pc-cygwin, X toolkit, Xaw3d scroll bars) of 2012-12-12 on CDW764-BURTONS Windowing system distributor `The Cygwin/X Project', version 11.0.11300000 Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Info Minor modes in effect: diff-auto-refine-mode: t winner-mode: t display-time-mode: t jabber-activity-mode: t rcirc-track-minor-mode: t shell-dirtrack-mode: t show-paren-mode: t desktop-save-mode: 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-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t Recent input: l o c a l - v a r i a b l e SPC ' c o n s ) C-j ( c o n s SPC x SPC y ) M-b M-b M-d M-d 1 SPC 2 C-e C-j C-p C-k C-k C-p C-k ( s e t f SPC ( s y m b o l - f u n c t i o n SPC ' c o n s ) S-SPC ( l a m b d a SPC ( x SPC y ) S-SPC ( + S-SPC x SPC y ) ) ) C-p C-e C-j ( c o n s SPC x SPC y 1 SPC 2 ) C-j M-: ( c o n s SPC 1 SPC 2 ) M-; M-: M-p M-; M-: M-p M-: M-; C-g M-; M-: M-p C-g C-x b * e s h M-: M-p c o n s SPC 1 SPC 2 C-x b C-p C-p C-p C-p C-p C-k C-n C-n C-p C-e C-n C-k C-k C-n C-k 3 C-p C-p C-p C-p C-p C-p C-p C-a C-k C-k C-k M-; M-; C-n C-n M-f M-f M-b C-h f C-e M-; C-e M-b M-; M-; M-v C-v C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n M-; M-; C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-x 2 C-x b C-p C-p C-p C-n C-a C-SPC C-n C-n C-n C-n C-n M-; M-; C-x b * i n n u C-n C-n C-n C-n C-n M-; C-k M-; M-; M-x r e p o r Recent messages: Checking 77 files in /home/burton.samograd/src/emacs-git/lisp/obsolete... Checking for load-path shadows...done user-error: Node has no Next 3 (#o3, #x3) [3 times] Quit [2 times] let: Command attempted to use minibuffer while in minibuffer Quit 3 (#o3, #x3) Type "q" in help window to restore its previous buffer. Mark activated Load-path shadows: ~/.emacs.d/emacs-jabber-0.8.91/srv hides /usr/local/share/emacs/site-lisp/srv ~/.emacs.d/emacs-jabber-0.8.91/jabber hides /usr/local/share/emacs/site-lisp/jabber ~/.emacs.d/emacs-jabber-0.8.91/jabber-xml hides /usr/local/share/emacs/site-lisp/jabber-xml ~/.emacs.d/emacs-jabber-0.8.91/jabber-xmessage hides /usr/local/share/emacs/site-lisp/jabber-xmessage ~/.emacs.d/emacs-jabber-0.8.91/jabber-wmii hides /usr/local/share/emacs/site-lisp/jabber-wmii ~/.emacs.d/emacs-jabber-0.8.91/jabber-widget hides /usr/local/share/emacs/site-lisp/jabber-widget ~/.emacs.d/emacs-jabber-0.8.91/jabber-watch hides /usr/local/share/emacs/site-lisp/jabber-watch ~/.emacs.d/emacs-jabber-0.8.91/jabber-version hides /usr/local/share/emacs/site-lisp/jabber-version ~/.emacs.d/emacs-jabber-0.8.91/jabber-vcard hides /usr/local/share/emacs/site-lisp/jabber-vcard ~/.emacs.d/emacs-jabber-0.8.91/jabber-vcard-avatars hides /usr/local/share/emacs/site-lisp/jabber-vcard-avatars ~/.emacs.d/emacs-jabber-0.8.91/jabber-util hides /usr/local/share/emacs/site-lisp/jabber-util ~/.emacs.d/emacs-jabber-0.8.91/jabber-truncate hides /usr/local/share/emacs/site-lisp/jabber-truncate ~/.emacs.d/emacs-jabber-0.8.91/jabber-time hides /usr/local/share/emacs/site-lisp/jabber-time ~/.emacs.d/emacs-jabber-0.8.91/jabber-socks5 hides /usr/local/share/emacs/site-lisp/jabber-socks5 ~/.emacs.d/emacs-jabber-0.8.91/jabber-si-server hides /usr/local/share/emacs/site-lisp/jabber-si-server ~/.emacs.d/emacs-jabber-0.8.91/jabber-si-common hides /usr/local/share/emacs/site-lisp/jabber-si-common ~/.emacs.d/emacs-jabber-0.8.91/jabber-si-client hides /usr/local/share/emacs/site-lisp/jabber-si-client ~/.emacs.d/emacs-jabber-0.8.91/jabber-search hides /usr/local/share/emacs/site-lisp/jabber-search ~/.emacs.d/emacs-jabber-0.8.91/jabber-screen hides /usr/local/share/emacs/site-lisp/jabber-screen ~/.emacs.d/emacs-jabber-0.8.91/jabber-sawfish hides /usr/local/share/emacs/site-lisp/jabber-sawfish ~/.emacs.d/emacs-jabber-0.8.91/jabber-sasl hides /usr/local/share/emacs/site-lisp/jabber-sasl ~/.emacs.d/emacs-jabber-0.8.91/jabber-roster hides /usr/local/share/emacs/site-lisp/jabber-roster ~/.emacs.d/emacs-jabber-0.8.91/jabber-register hides /usr/local/share/emacs/site-lisp/jabber-register ~/.emacs.d/emacs-jabber-0.8.91/jabber-ratpoison hides /usr/local/share/emacs/site-lisp/jabber-ratpoison ~/.emacs.d/emacs-jabber-0.8.91/jabber-private hides /usr/local/share/emacs/site-lisp/jabber-private ~/.emacs.d/emacs-jabber-0.8.91/jabber-presence hides /usr/local/share/emacs/site-lisp/jabber-presence ~/.emacs.d/emacs-jabber-0.8.91/jabber-ping hides /usr/local/share/emacs/site-lisp/jabber-ping ~/.emacs.d/emacs-jabber-0.8.91/jabber-ourversion hides /usr/local/share/emacs/site-lisp/jabber-ourversion ~/.emacs.d/emacs-jabber-0.8.91/jabber-osd hides /usr/local/share/emacs/site-lisp/jabber-osd ~/.emacs.d/emacs-jabber-0.8.91/jabber-newdisco hides /usr/local/share/emacs/site-lisp/jabber-newdisco ~/.emacs.d/emacs-jabber-0.8.91/jabber-muc hides /usr/local/share/emacs/site-lisp/jabber-muc ~/.emacs.d/emacs-jabber-0.8.91/jabber-muc-nick-completion hides /usr/local/share/emacs/site-lisp/jabber-muc-nick-completion ~/.emacs.d/emacs-jabber-0.8.91/jabber-muc-nick-coloring hides /usr/local/share/emacs/site-lisp/jabber-muc-nick-coloring ~/.emacs.d/emacs-jabber-0.8.91/jabber-modeline hides /usr/local/share/emacs/site-lisp/jabber-modeline ~/.emacs.d/emacs-jabber-0.8.91/jabber-menu hides /usr/local/share/emacs/site-lisp/jabber-menu ~/.emacs.d/emacs-jabber-0.8.91/jabber-logon hides /usr/local/share/emacs/site-lisp/jabber-logon ~/.emacs.d/emacs-jabber-0.8.91/jabber-libnotify hides /usr/local/share/emacs/site-lisp/jabber-libnotify ~/.emacs.d/emacs-jabber-0.8.91/jabber-keymap hides /usr/local/share/emacs/site-lisp/jabber-keymap ~/.emacs.d/emacs-jabber-0.8.91/jabber-keepalive hides /usr/local/share/emacs/site-lisp/jabber-keepalive ~/.emacs.d/emacs-jabber-0.8.91/jabber-iq hides /usr/local/share/emacs/site-lisp/jabber-iq ~/.emacs.d/emacs-jabber-0.8.91/jabber-history hides /usr/local/share/emacs/site-lisp/jabber-history ~/.emacs.d/emacs-jabber-0.8.91/jabber-gmail hides /usr/local/share/emacs/site-lisp/jabber-gmail ~/.emacs.d/emacs-jabber-0.8.91/jabber-ft-server hides /usr/local/share/emacs/site-lisp/jabber-ft-server ~/.emacs.d/emacs-jabber-0.8.91/jabber-ft-common hides /usr/local/share/emacs/site-lisp/jabber-ft-common ~/.emacs.d/emacs-jabber-0.8.91/jabber-ft-client hides /usr/local/share/emacs/site-lisp/jabber-ft-client ~/.emacs.d/emacs-jabber-0.8.91/jabber-festival hides /usr/local/share/emacs/site-lisp/jabber-festival ~/.emacs.d/emacs-jabber-0.8.91/jabber-feature-neg hides /usr/local/share/emacs/site-lisp/jabber-feature-neg ~/.emacs.d/emacs-jabber-0.8.91/jabber-export hides /usr/local/share/emacs/site-lisp/jabber-export ~/.emacs.d/emacs-jabber-0.8.91/jabber-events hides /usr/local/share/emacs/site-lisp/jabber-events ~/.emacs.d/emacs-jabber-0.8.91/jabber-disco hides /usr/local/share/emacs/site-lisp/jabber-disco ~/.emacs.d/emacs-jabber-0.8.91/jabber-core hides /usr/local/share/emacs/site-lisp/jabber-core ~/.emacs.d/emacs-jabber-0.8.91/jabber-console hides /usr/local/share/emacs/site-lisp/jabber-console ~/.emacs.d/emacs-jabber-0.8.91/jabber-conn hides /usr/local/share/emacs/site-lisp/jabber-conn ~/.emacs.d/emacs-jabber-0.8.91/jabber-compose hides /usr/local/share/emacs/site-lisp/jabber-compose ~/.emacs.d/emacs-jabber-0.8.91/jabber-chatstates hides /usr/local/share/emacs/site-lisp/jabber-chatstates ~/.emacs.d/emacs-jabber-0.8.91/jabber-chatbuffer hides /usr/local/share/emacs/site-lisp/jabber-chatbuffer ~/.emacs.d/emacs-jabber-0.8.91/jabber-chat hides /usr/local/share/emacs/site-lisp/jabber-chat ~/.emacs.d/emacs-jabber-0.8.91/jabber-browse hides /usr/local/share/emacs/site-lisp/jabber-browse ~/.emacs.d/emacs-jabber-0.8.91/jabber-bookmarks hides /usr/local/share/emacs/site-lisp/jabber-bookmarks ~/.emacs.d/emacs-jabber-0.8.91/jabber-awesome hides /usr/local/share/emacs/site-lisp/jabber-awesome ~/.emacs.d/emacs-jabber-0.8.91/jabber-avatar hides /usr/local/share/emacs/site-lisp/jabber-avatar ~/.emacs.d/emacs-jabber-0.8.91/jabber-autoloads hides /usr/local/share/emacs/site-lisp/jabber-autoloads ~/.emacs.d/emacs-jabber-0.8.91/jabber-autoaway hides /usr/local/share/emacs/site-lisp/jabber-autoaway ~/.emacs.d/emacs-jabber-0.8.91/jabber-alert hides /usr/local/share/emacs/site-lisp/jabber-alert ~/.emacs.d/emacs-jabber-0.8.91/jabber-ahc hides /usr/local/share/emacs/site-lisp/jabber-ahc ~/.emacs.d/emacs-jabber-0.8.91/jabber-ahc-presence hides /usr/local/share/emacs/site-lisp/jabber-ahc-presence ~/.emacs.d/emacs-jabber-0.8.91/jabber-activity hides /usr/local/share/emacs/site-lisp/jabber-activity ~/.emacs.d/emacs-jabber-0.8.91/hexrgb hides /usr/local/share/emacs/site-lisp/hexrgb ~/.emacs.d/emacs-jabber-0.8.91/fsm hides /usr/local/share/emacs/site-lisp/fsm Features: (shadow emacsbug goto-addr view log-edit pcvs-util add-log debug make-mode dired vc ffap org ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys org-pcomplete org-list org-faces org-entities org-version ob-emacs-lisp ob org-compat org-macs ob-eval org-loaddefs cal-menu calendar cal-loaddefs diff-mode grep compile nxml-uchnm rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc xmltok pcmpl-unix tramp-cmds noutline outline gnus-fun mailalias smtpmail sendmail epg find-func help-mode jka-compr info misearch multi-isearch em-unix em-term em-script em-prompt em-ls em-hist em-pred em-glob em-dirs em-cmpl em-basic em-banner em-alias esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups eshell esh-module esh-mode esh-util flow-fill mule-util canlock url-http url-gw url-auth url-queue url-cache url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse url-vars smiley gnus-cite qp gnus-dup sort shr-color color shr mm-archive mail-extr gnus-async gnus-bcklg gnus-ml nndraft nnmh nnfolder utf-7 rfc2104 gnutls network-stream nnimap parse-time utf7 netrc gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime dig nntp gnus-cache gnus-sum nnoo gnus-group gnus-undo nnmail mail-source tramp-cache gnus-start gnus-spec gnus-int gnus-range message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums gmm-utils mailheader gnus-win gnus gnus-ems tramp-sh nnheader mail-utils vc-git eldoc imenu antlr-mode vc-dispatcher vc-svn cc-langs cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs winner time cus-start cus-load etags slime-fancy slime-fontifying-fu slime-package-fu slime-references slime-scratch slime-presentations slime-fuzzy slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc slime-parse slime-repl slime derived easy-mmode pp hyperspec thingatpt browse-url jabber jabber-libnotify dbus jabber-awesome jabber-osd jabber-wmii jabber-xmessage jabber-festival jabber-sawfish jabber-ratpoison jabber-screen jabber-socks5 jabber-ft-server jabber-si-server jabber-ft-client jabber-ft-common jabber-si-client jabber-si-common jabber-feature-neg jabber-truncate jabber-time jabber-autoaway jabber-vcard-avatars jabber-chatstates jabber-events jabber-vcard jabber-avatar mailcap jabber-activity jabber-watch jabber-modeline jabber-ahc-presence jabber-ahc jabber-version jabber-ourversion jabber-muc-nick-completion hippie-exp jabber-browse jabber-search jabber-register jabber-roster jabber-presence jabber-muc jabber-muc-nick-coloring assoc hexrgb jabber-newdisco jabber-widget jabber-disco wid-edit jabber-chat jabber-history jabber-chatbuffer jabber-alert jabber-iq jabber-core jabber-console sgml-mode ewoc jabber-keymap jabber-sasl sasl sasl-anonymous sasl-login sasl-plain fsm jabber-logon jabber-conn srv dns starttls tls jabber-xml xml jabber-menu jabber-autoloads jabber-util rcirc mailabbrev tramp tramp-compat auth-source eieio gnus-util mm-util mail-prsvr password-cache tramp-loaddefs shell byte-opt warnings pcomplete comint ansi-color format-spec advice help-fns advice-preload edmacro kmacro cl-macs windmove term disp-table easymenu ehelp electric ring bytecomp byte-compile cconv paren server gv desktop cl cl-lib time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting x-toolkit x multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 17 15:07:57 2012 Received: (at control) by debbugs.gnu.org; 17 Dec 2012 20:07:58 +0000 Received: from localhost ([127.0.0.1]:47565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tkgyj-00028g-Nx for submit@debbugs.gnu.org; Mon, 17 Dec 2012 15:07:57 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:22189) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tkgyh-00028T-Uf; Mon, 17 Dec 2012 15:07:56 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai0FAG6Zu09FxLDj/2dsb2JhbABEsEiDSYEIghYBBVYjEAs0EhQYDSSIIboJkEQDiEKacYFYgwc X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="210108750" Received: from 69-196-176-227.dsl.teksavvy.com (HELO pastel.home) ([69.196.176.227]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 17 Dec 2012 15:06:38 -0500 Received: by pastel.home (Postfix, from userid 20848) id E54D558FA3; Mon, 17 Dec 2012 15:06:38 -0500 (EST) From: Stefan Monnier To: Burton Samograd Subject: Re: bug#13212: 24.2.90; setf (symbol-function ...) does not set buffer local variable if present Message-ID: References: Date: Mon, 17 Dec 2012 15:06:38 -0500 In-Reply-To: (Burton Samograd's message of "Mon, 17 Dec 2012 10:26:50 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: control Cc: 13212-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.5 (/) tags 13212 notabug thanks > (make-local-variable 'cons) > (setf (symbol-function 'cons) (lambda (x y) (+ x y))) buffer-local variables affect only variables, not functions. I.e. they affect symbol-value, not symbol-function. Elisp does not provide buffer-local functions, so you have to use things like (if (derived-mode-p 'foo-mode) ...) instead. An alternative is: (defvar-local my-foo-function (lambda () (some (default) behavior))) (defun my-foo () (funcall my-foo-function)) -- Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 17 15:33:28 2012 Received: (at 13212-done) by debbugs.gnu.org; 17 Dec 2012 20:33:29 +0000 Received: from localhost ([127.0.0.1]:47614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkhNQ-0003cl-My for submit@debbugs.gnu.org; Mon, 17 Dec 2012 15:33:28 -0500 Received: from [69.90.114.176] (port=59019 helo=samograd.ca) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkhNO-0003bZ-9A for 13212-done@debbugs.gnu.org; Mon, 17 Dec 2012 15:33:26 -0500 Received: from CDW764-BURTONS.QFTI.COM (localhost.localdomain [127.0.0.1]) by samograd.ca (Postfix) with ESMTP id 33C7352F403A; Mon, 17 Dec 2012 13:31:27 -0700 (MST) From: Burton Samograd To: Stefan Monnier Subject: Re: bug#13212: 24.2.90; setf (symbol-function ...) does not set buffer local variable if present References: Date: Mon, 17 Dec 2012 13:31:29 -0700 In-Reply-To: (Stefan Monnier's message of "Mon, 17 Dec 2012 15:06:38 -0500") Message-ID: User-Agent: Gnus/5.1299999999999999 (Gnus v5.13) Emacs/24.2.90 (cygwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.6 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Stefan Monnier writes: > tags 13212 notabug > thanks > >> (make-local-variable 'cons) >> (setf (symbol-function 'cons) (lambda (x y) (+ x y))) > > buffer-local variables affect only variables, not functions. > I.e. they affect symbol-value, not symbol-function. Elisp does not provide > buffer-local functions, so you have to use things like > (if (derived-mode-p 'foo-mode) ...) instead. > An alternative is: > > (defvar-local my-foo-function (lambda () (some (default) behavior))) > > (defun my-foo () > (funcall my-foo-function)) [...] Content analysis details: (1.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.5000] 0.8 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: 13212-done Cc: 13212-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 1.6 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Stefan Monnier writes: > tags 13212 notabug > thanks > >> (make-local-variable 'cons) >> (setf (symbol-function 'cons) (lambda (x y) (+ x y))) > > buffer-local variables affect only variables, not functions. > I.e. they affect symbol-value, not symbol-function. Elisp does not provide > buffer-local functions, so you have to use things like > (if (derived-mode-p 'foo-mode) ...) instead. > An alternative is: > > (defvar-local my-foo-function (lambda () (some (default) behavior))) > > (defun my-foo () > (funcall my-foo-function)) [...] Content analysis details: (1.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.4703] 0.8 RDNS_NONE Delivered to internal network by a host with no rDNS Stefan Monnier writes: > tags 13212 notabug > thanks > >> (make-local-variable 'cons) >> (setf (symbol-function 'cons) (lambda (x y) (+ x y))) > > buffer-local variables affect only variables, not functions. > I.e. they affect symbol-value, not symbol-function. Elisp does not provide > buffer-local functions, so you have to use things like > (if (derived-mode-p 'foo-mode) ...) instead. > An alternative is: > > (defvar-local my-foo-function (lambda () (some (default) behavior))) > > (defun my-foo () > (funcall my-foo-function)) Thanks for the explanation. -- Burton Samograd From unknown Mon Aug 18 02:38:00 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 15 Jan 2013 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator