From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Mastro Newsgroups: gmane.emacs.help Subject: Re: prevent hook vanishing Date: Fri, 18 May 2018 06:58:01 -0700 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1526652460 22813 195.159.176.226 (18 May 2018 14:07:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 18 May 2018 14:07:40 +0000 (UTC) Cc: akrl@sdf.org To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 18 16:07:36 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fJg2h-0005nt-VF for geh-help-gnu-emacs@m.gmane.org; Fri, 18 May 2018 16:07:36 +0200 Original-Received: from localhost ([::1]:39198 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJg4n-0008Te-J4 for geh-help-gnu-emacs@m.gmane.org; Fri, 18 May 2018 10:09:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJftf-0000MR-0a for help-gnu-emacs@gnu.org; Fri, 18 May 2018 09:58:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJftd-0003nh-UB for help-gnu-emacs@gnu.org; Fri, 18 May 2018 09:58:15 -0400 Original-Received: from mail-qt0-x235.google.com ([2607:f8b0:400d:c0d::235]:46642) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fJftd-0003nL-QR for help-gnu-emacs@gnu.org; Fri, 18 May 2018 09:58:13 -0400 Original-Received: by mail-qt0-x235.google.com with SMTP id m16-v6so10324347qtg.13 for ; Fri, 18 May 2018 06:58:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=73ekIsMmcwCchjRawaYOVCCyoYq5q1B1VeWqmBzMMs4=; b=jtEWagYsVYgADrsqsa4I/Y0iKoxG+m9CC3w/fwdDbR7ytT9XZJwqfoJtZOOMdupFwb ee9qeS7jTydRl5RfNmlNZ96ZK+UE3lfk6lW5WZy8r03HdhX622cWt2+E0RNmnkYksPqr KRqgGmXCIydJ/Q5+LGlPZohdANOCURYTzRbR2mD7uYCrSAmeZZeWpH2tjipv2Ze1igVd qYygXRcEAgGdLk8a4eqgpWZFtDs/+Q4NAecjvoAqRYPApszu1pJRhTcqye3zvbijqBLL SMxP2lGHpkF4+M2FV6zpHpNa0ioLBo3hcNuTMjTDmZxQGwvAnrX/BFZ788S0HaCoe8d2 ODDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=73ekIsMmcwCchjRawaYOVCCyoYq5q1B1VeWqmBzMMs4=; b=jwmu6Z2EfXKfRcsBroWf7utrnaE2GWL/Xgt4GTx1RXLMyfra8c4+OM2UGCQTxaPeI+ X0ypyOSK+jMaQNZyEsQ/aDNTxUHdHHeYCNTOM/ZcZUy0cPMC0XUcOZGBESLIXdnvhJrW N7B7oQL75UjX3lsRDhWn0OEsp5GMfy8if+IPLFOqrnnyZNMFWzbe94Ak5BaM1SIE/5N2 MVjEeLbf+/6zpKe7pFgB1kGgBIIfPIHSqdfJTVz7kxNnomyjR9g6vj0HfsamgKIpAW2w /0fEYGvaWKkbUx936ciwf1xIZhB6bET7oWI+KSrh/kQ8UA6TKlNGFkvsoUVIt2mzpTZW K5AQ== X-Gm-Message-State: ALKqPwfUssmdp+Gwzvmo6JaGQjdowNjHQfFmKzKjqhcJYMO109uLx6VE /Ux3JWaww70m4y24ZFB/sCn5jlo5qC4ZERddBKqZ4spx X-Google-Smtp-Source: AB8JxZpWZrAyJ5L21rl2nSDeW7wDcfAsIpIAHo/yKKlS+Lgw/Yru59MA6Eg6oGligcxGnpUKQaffovX1099wCAW0R/c= X-Received: by 2002:aed:2411:: with SMTP id r17-v6mr9193630qtc.273.1526651892707; Fri, 18 May 2018 06:58:12 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::235 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:116765 Archived-At: akrl wrote: > How do I prevent emacs from removing a hook I've installed using > something like: (add-hook 'after-change-functions 'render-buf nil t) > in case of an error occur executing it? > I would also be fine in being able to reinstall it somehow afterward. Why not use `condition-case' in your hook function to catch the error and respond appropriately? (There are also `with-demoted-errors' and `ignore-errors', if there's nothing that needs to be except to suppress the error) John